binutils Newspaper
OCTOBER 6, 2026
s390 — Proposed

s390: Treat signed/unsigned immediate operands in .insn pseudo-mnemonics as either

Handle mixed signed/unsigned immediate operands in s390 .insn pseudo-mnemonics.

This patch modifies the s390 gas assembler to correctly handle immediate operands in .insn pseudo-mnemonics, which can be either signed or unsigned depending on the instruction. It introduces a new flag and modifies the operand range check to accommodate this, storing opcode and operand pointers for fixup processing. This change also cleans up how operand indices are handled in fixup data.

In Details

This change in gas for s390 enables the correct range checking for immediate operands within .insn pseudo-mnemonics. It uses the PSEUDO_MNEMONIC flag to signal a mixed signed/unsigned range check in s390_insert_operand, passing opcode pointers for context. Fixup data now stores both opcode and operand pointers to facilitate this, removing reliance on operand index encoding in relocation types.

For Context
.insn
A GNU assembler directive that allows embedding raw instruction bytes or defining pseudo-mnemonics for specific instruction formats.
pseudo-mnemonic
An assembly language construct that represents a machine instruction, potentially with operands that are not direct encodings of machine code but are processed by the assembler.
fixup
A placeholder in assembled code that needs to be resolved later, typically by the linker, to a correct address or value based on symbolic information.
operand
A value or symbol that an instruction operates on.
range check
Verifying that a given value falls within a specified minimum and maximum boundary.
Filed Under: s390gas.insnoperandsfixups