The mask is wrong. The bitfield insns number the bits from MSB to LSB,
not
the other way round, as the single bit insns do. Also, a width of 0 is
replaced by 32.
^^^^^^^^^^^^^^
This does only happen for immediate modes
No, also for non-immediate. A bitfield can never be empty.
Width field
Specifies the field width, depending on Dw.
If Dw = 0, the width field is an immediate operand; an operand
value in the range 1 - 31 specifies a field width of 1 - 31, and
a value of zero specifies a width of 32.
If Dw = 1, the width field specifies a data register that contains
the width. The value is modulo 32; values of 1 - 31 specify
field widths of 1 - 31, and a value of zero specifies a width of
32.