Bit-Fields#
Special expression codes exist to represent bit-field instructions.
(sign_extract:m loc size pos)This represents a reference to a sign-extended bit-field contained or starting in
loc(a memory or register reference). The bit-field issizebits wide and starts at bitpos. The compilation optionBITS_BIG_ENDIANsays which end of the memory unitposcounts from.If
locis in memory, its mode must be a single-byte integer mode. Iflocis in a register, the mode to use is specified by the operand of theinsvorextvpattern (see Standard Pattern Names For Generation) and is usually a full-word integer mode, which is the default if none is specified.The mode of
posis machine-specific and is also specified in theinsvorextvpattern.The mode
mis the same as the mode that would be used forlocif it were a register.A
sign_extractcannot appear as an lvalue, or part thereof, in RTL.(zero_extract:m loc size pos)Like
sign_extractbut refers to an unsigned or zero-extended bit-field. The same sequence of bits are extracted, but they are filled to an entire word with zeros instead of by sign-extension.Unlike
sign_extract, this type of expressions can be lvalues in RTL; they may appear on the left side of an assignment, indicating insertion of a value into the specified bit-field.