What padding? bitregion_end-bitregion_start+1 will be 32, but in

Poop, I misread your example.

get_best_mode I see

+ maxbits = bitregion_end - bitpos + 1;

which is 28. No?

Yes, but if you look at the next few lines you'll see:

  /* Find the narrowest integer mode that contains the bit field.  */
  for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
       mode = GET_MODE_WIDER_MODE (mode))
    {
      unit = GET_MODE_BITSIZE (mode);
      if ((bitpos % unit) + bitsize <= unit)
        break;
    }

The narrowest integer mode containing the bit field is still 32, so we access the bitfield with an SI instruction as expected.

Incidentally, I would expect _end to be one past the end rather than the
index of the last element, but perhaps I just expect that because C++
iterators work that way.

I can fix that.

Aldy

Reply via email to