binutils Newspaper
OCTOBER 6, 2026
s390/opcodes — Proposed

s390: cksm operand R2 must be a register pair

Updates S/390 opcode definitions for `cksm` to enforce that R2 must be an even-numbered register forming a pair.

This patch modifies the S/390 opcode definitions for the cksm instruction. It introduces a new instruction format, RRE_RRE, which correctly enforces that the second operand (R2) must be an even-numbered register, as cksm operates on an even-odd register pair. The test suite is updated to reflect this constraint, ensuring correct assembly and disassembly.

In Details

This patch modifies the S/390 opcode definitions to correctly represent the constraints of the cksm instruction. The cksm R1,R2 instruction requires that R2 refers to an even-numbered register, which implicitly defines an even-odd register pair (e.g., R8 and R9). A new instruction format, INSTR_RRE_RRE and MASK_RRE_RRE, is introduced in s390-opc.c to enforce this requirement. The test cases in gas/testsuite/gas/s390/esa-g5.d and esa-g5.s are updated to use an even register for R2 (%r8 instead of %r9) to pass validation.

For Context
s390
IBM's 31-bit and 64-bit mainframe architecture.
opcode
A machine language instruction.
cksm
An S/390 instruction for checksum calculation.
register pair
In S/390 architecture, certain instructions operate on two consecutive registers, where the first register must have an even number.
Filed Under: s390architectureopcodeslinkerassembler