s390: Treat signed/unsigned immediate operands in .insn pseudo-mnemonics as either
Subsequent commits add all z/Architecture instruction formats including
any variants as .insn pseudo-mnemonics. Immediate operands in those
can be either signed or unsigned, depending on the instruction.
Therefore the immediate value range check must be performed so that any
possible signed and unsigned value is valid. That is the values are
within the range [-min_signed, max_unsigned].
Instead of defining a new set of mixed signed and unsigned immediate
operand types as well as new instruction formats use the PSEUDO_MNEMONIC
instruction flag as indication whether to perform this special range
check in s390_insert_operand() for both signed and unsigned operands.
Pass the opcode pointer to s390_insert_operand(). When creating fixups
store the opcode and operand pointers in the target-specific fixup data,
so that md_apply_fix() can pass them to s390_insert_operand().
As a side benefit the operand index is no longer encoded in the fixup
relocation type (as BFD_RELOC_UNUSED + operand index), as the operand
pointer is now contained in the fixup structure.
gas/
* config/tc-s390.h (struct s390_fix_data): New s390-specific
fixup data structure.
(TC_FIX_TYPE, TC_INIT_FIX_DATA): New defines.
* config/tc-s390.c (s390_insert_operand): Treat signed/unsigned
immediate operands in .insn pseudo-mnemonics as either.
(struct s390_fixup): Store operand pointer instead of index.
(md_gather_operands): Likewise. Pass opcode to
s390_insert_operand. Store opcode and operand pointers in
target-specific fixup data.
(md_apply_fix): Pass opcode and operand pointers to
s390_insert_operand.
* doc/c-s390.texi (s390 Formats): Document operand Ix as un-/
signed immediate with range min. signed to max. unsigned.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
3 files changed