[PATCH v2 29/47] s390: Add .insn pseudo-mnemonics rsy_a/b
Jens Remus
jremus@linux.ibm.com
Fri Nov 6 15:57:19 GMT 2026
Instruction format RSY got added with IBM z990. [1]
Note that the assembler does not evaluate or enforce the specified mode
and minimum architecture/CPU level for .insn pseudo-mnemonics.
While at it add a z/Architecture test for .insn rsy pseudo-mnemonic.
[1]: IBM z/Architecture Principles of Operation, SA22-7832-02, IBM z990,
https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr002.pdf
opcodes/
* s390-opc.c (INSTR_RSY_RRRD2, MASK_RSY_RRRD2): Define
instruction format for RSY-a with operands in ascending order.
(s390_opformats): Add pseudo-mnemonics rsy_a and rsy_b.
gas/
* doc/c-s390.texi (s390 Formats): Document RSY operand order.
gas/testsuite/
* gas/s390/zarch-operands.d: Add tests for .insn rsy, rsy_a, and
rsy_b.
* gas/s390/zarch-operands.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
Notes (jremus):
Changes in v2:
- Correct rsy_b mode to z/Architecture (2). (Andreas)
- Reword commit message to no longer claim the minimum architecture/CPU
level would be enforced. (Andreas)
gas/doc/c-s390.texi | 1 +
gas/testsuite/gas/s390/zarch-operands.d | 6 ++++++
gas/testsuite/gas/s390/zarch-operands.s | 3 +++
opcodes/s390-opc.c | 4 ++++
4 files changed, 14 insertions(+)
diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index e44b92ee2f6a..5de8f80465e6 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -427,6 +427,7 @@ a @emph{Programming Note} of the Principles of Operation manual:
@item RS (@code{rs}; not RS-a/b): @code{R1,R3,D2(B2)}
@item RSE (@code{rse}): @code{R1,R3,D2(B2)}
@item RSI (@code{rsi}): @code{R1,R3,RI2}
+@item RSY (@code{rsy}; not RSY-a/b): @code{R1,R3,D2(B2)}
@end itemize
An instruction is two, four, or six bytes in length and must be aligned
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 9e599ffc3900..0dca51aa75c3 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -98,5 +98,11 @@ Disassembly of section .text:
.*: eb a0 10 6f 00 c0 [ ]*tp 111\(11,%r1\)
# RSL-b
.*: ed 15 20 de 13 ae [ ]*cdpt %f1,222\(22,%r2\),3
+# RSY
+.*: eb 13 26 ce 05 1d [ ]*rll %r1,%r3,22222\(%r2\)
+# RSY-a
+.*: eb 13 2f ff ff 1d [ ]*rll %r1,%r3,-1\(%r2\)
+# RSY-b
+.*: eb 13 2f ff ff 81 [ ]*icmy %r1,3,-1\(%r2\)
.*: c8 50 20 01 40 03 [ ]*mvcos 1\(%r2\),3\(%r4\),%r5
#?.*: 07 07 [ ]*nopr %r7
diff --git a/gas/testsuite/gas/s390/zarch-operands.s b/gas/testsuite/gas/s390/zarch-operands.s
index e2aa8c8504de..e463147e76bd 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -48,4 +48,7 @@ foo:
.insn rsi,0x84000000,%r1,%r3,. # brxh %r1,%r3,.
.insn rsl_a,0xeb00000000c0,111(11,%r1) # tp 111(11,%r1)
.insn rsl_b,0xed00000000ae,%f1,222(22,%r2),3 # cdpt %f1,222(22,%r2),3
+ .insn rsy,0xeb000000001d,%r1,%r3,22222(%r2) # rll %r1,%r3,22222(%r2)
+ .insn rsy_a,0xeb000000001d,%r1,-1(%r2),%r3 # rll %r1,%r3,-1(%r2)
+ .insn rsy_b,0xeb0000000081,%r1,-1(%r2),3 # icmy %r1,3,-1(%r2)
.insn ssf,0xc80000000000,1(%r2),3(%r4),%r5
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index b6e6ac16f7a9..5c47fe1e6986 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -428,6 +428,7 @@ unused_s390_operands_static_asserts (void)
#define INSTR_RSL_LRDRU 6, { R_32,D_20,L8_8,B_16,U4_36,0 } /* e.g. .insn rsl_b */
#define INSTR_RSI_RRP 4, { R_8,R_12,J16_16,0,0,0 } /* e.g. brxh */
#define INSTR_RSY_RRRD 6, { R_8,R_12,D20_20,B_16,0,0 } /* e.g. stmy */
+#define INSTR_RSY_RRRD2 6, { R_8,D20_20,B_16,R_12,0,0 } /* e.g. .insn rsy_a */
#define INSTR_RSY_RERERD 6, { RE_8,RE_12,D20_20,B_16,0,0 } /* e.g. cdsy */
#define INSTR_RSY_RURD 6, { R_8,U4_12,D20_20,B_16,0,0 } /* e.g. icmh */
#define INSTR_RSY_RURD2 6, { R_8,D20_20,B_16,U4_12,0,0 } /* e.g. loc */
@@ -681,6 +682,7 @@ unused_s390_operands_static_asserts (void)
#define MASK_RS_RURD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RS_RURD2 { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RSY_RRRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
+#define MASK_RSY_RRRD2 { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
#define MASK_RSY_RERERD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
#define MASK_RSY_RURD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
#define MASK_RSY_RURD2 { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
@@ -839,6 +841,8 @@ const struct s390_opcode s390_opformats[] =
{ "rsl_a",OP8(0x00LL), MASK_RSL_R0RD, INSTR_RSL_R0RD, 3, 0, 256, NULL },
{ "rsl_b",OP8(0x00LL), MASK_RSL_LRDRU, INSTR_RSL_LRDRU, 2, 8, 256, NULL },
{ "rsy", OP8(0x00LL), MASK_RSY_RRRD, INSTR_RSY_RRRD, 3, 3, 256, NULL },
+ { "rsy_a",OP8(0x00LL), MASK_RSY_RRRD2, INSTR_RSY_RRRD2, 3, 3, 256, NULL },
+ { "rsy_b",OP8(0x00LL), MASK_RSY_RURD2, INSTR_RSY_RURD2, 2, 3, 256, NULL },
{ "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3, 0, 256, NULL },
{ "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3, 0, 256, NULL },
{ "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR, 3, 0, 256, NULL },
--
2.53.0
More information about the Binutils
mailing list