This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] bitpacking rewrite


> 
> The following preliminary patch rewrites bitpacking to happen
> word-by-word and on the stack (well, in the preliminary form
> only on the stack after inlining).
> 
> Comments?

I like the change. Probably instead of bp/bp_s game, I would go with
adding &bp to every caller, but I do not care.

> + static inline void
> + bp_pack_value (struct bitpack_d *bp, bitpack_word_t val, unsigned nbits)
> + {
> +   bitpack_word_t word = bp->word;
> +   int pos = bp->pos;
> +   /* If val does not fit into the current bitpack word switch to the
> +      next one.  */
> +   if (pos + nbits > BITS_PER_BITPACK_WORD)
> +     {
> +       lto_output_uleb128_stream ((struct lto_output_stream *) bp->stream, word);

Hehe, I never got to idea that one can actually output the bitpack when it overflows
first word ;)
I guess you want to add some checking asserts that nbits does not exceed BITS_PER_BITPACK_WORD.

So next step would be to optimize ulebs/slebs, right? :)

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]