On Tuesday 23 November 2010 20:09:52, Joern Rennecke wrote:
> If we changed BITS_PER_UNIT into an ordinary piece-of-data 'hook', this
> would not only cost a data load from the target vector, but would also
> inhibit optimizations that replace division / modulo / multiply with shift
> or mask operations.

Have you done any sort of measurement, to see if what is lost
is actually noticeable in practice?

> So maybe we should look into having a few functional hooks that do  
> common operations, i.e.
> bits_in_units        x / BITS_PER_UNIT
> bits_in_units_ceil   (x + BITS_PER_UNIT - 1) / BITS_PER_UNIT
> bit_unit_remainder   x % BITS_PER_UNIT
> units_in_bits        x * BITS_PER_UNIT

-- 
Pedro Alves

Reply via email to