[binutils-gdb] s390: Add .insn pseudo-mnemonic rrd

Jens Remus jremus@sourceware.org
Tue Nov 10 16:49:33 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=559b493c363ca0739f7d8aa09c5f4ff8e47ee89b

commit 559b493c363ca0739f7d8aa09c5f4ff8e47ee89b
Author: Jens Remus <jremus@linux.ibm.com>
Date:   Tue Nov 10 17:46:02 2026 +0100

    s390: Add .insn pseudo-mnemonic rrd
    
    Instruction format RRD has been introduced with IBM z196. [1]  It
    got separated out from RRF.  Therefore do not specify a minimum
    architecture/CPU level.
    
    Note that the assembler does not evaluate or enforce the specified mode
    and minimum architecture/CPU level for .insn pseudo-mnemonics.
    
    [1]: IBM z/Architecture Principles of Operation, SA22-7832-08, IBM z196,
         https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr008.pdf
    
    opcodes/
            * s390-opc.c (s390_opformats): Add pseudo-mnemonic rrd.
    
    gas/
            * doc/c-s390.texi (s390 Formats): Document instruction format
            RRD.
    
    gas/testsuite/
            * gas/s390/zarch-operands.d: Add test for .insn rrd.
            * gas/s390/zarch-operands.s: Likewise.
    
    Signed-off-by: Jens Remus <jremus@linux.ibm.com>

Diff:
---
 gas/doc/c-s390.texi                     | 8 ++++++++
 gas/testsuite/gas/s390/zarch-operands.d | 2 ++
 gas/testsuite/gas/s390/zarch-operands.s | 1 +
 opcodes/s390-opc.c                      | 3 +++
 4 files changed, 14 insertions(+)

diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index 855e600dc1a..5505f005d67 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -525,6 +525,14 @@ with the @samp{.insn} pseudo directive:
 0         8    12  15
 @end verbatim
 
+@item RRD format: <insn> R1,R2,R3
+@verbatim
++-------------------+----+----+----+----+
+|      OpCode       | R1 |////| R3 | R2 |
++-------------------+----+----+----+----+
+0                   16   20   24   28  31
+@end verbatim
+
 @item RRE format: <insn> R1,R2
 @verbatim
 +-------------------+---------+----+----+
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 3284d66468a..72fa45ba0ba 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -58,6 +58,8 @@ Disassembly of section .text:
 # RR
 .*:	1a 12 [	 ]*ar	%r1,%r2
 .*:	04 10 [	 ]*spm	%r1
+# RRD
+.*:	b3 2e 10 32 [	 ]*maer	%f1,%f3,%f2
 .*:	eb 12 40 03 00 0d [	 ]*sllg	%r1,%r2,3\(%r4\)
 .*:	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 d385e72507b..76745442865 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -24,5 +24,6 @@ foo:
 	.insn ris,0xec00000000fe,%r1,-2,3,444(%r4)	# cib %r1,-2,3,444(%r4)
 	.insn rr,0x1a00,%r1,%r2				# ar %r1,%r2
 	.insn rr,0x0400,%r1				# spm %r1
+	.insn rrd,0xb32e0000,%f1,%f2,%f3		# maer %f1,%f3,%f2
 	.insn rse,0xeb000000000d,%r1,%r2,3(%r4)
 	.insn ssf,0xc80000000000,1(%r2),3(%r4),%r5
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index 9b0b5dd3e0b..eee7c636276 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -343,6 +343,7 @@ unused_s390_operands_static_asserts (void)
 #define INSTR_RIS_R0RDI    6, { R_8,I8_32,D_20,B_16,0,0 }        /* e.g. cibne */
 #define INSTR_RIS_RURDU    6, { R_8,U8_32,U4_12,D_20,B_16,0 }    /* e.g. clib  */
 #define INSTR_RIS_R0RDU    6, { R_8,U8_32,D_20,B_16,0,0 }        /* e.g. clibne*/
+#define INSTR_RRD_R0RR     4, { R_16,R_28,R_24,0,0,0 }           /* e.g. .insn rrd */
 #define INSTR_RRD_F0FF     4, { F_16,F_24,F_28,0,0,0 }           /* e.g. madbr */
 #define INSTR_RRD_FE0FF    4, { FE_16,F_24,F_28,0,0,0 }          /* e.g. myr   */
 #define INSTR_RRE_00       4, { 0,0,0,0,0,0 }                    /* e.g. palb  */
@@ -581,6 +582,7 @@ unused_s390_operands_static_asserts (void)
 #define MASK_RIS_R0RDI    { 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff }
 #define MASK_RIS_RURDU    { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
 #define MASK_RIS_R0RDU    { 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff }
+#define MASK_RRD_R0RR     { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
 #define MASK_RRD_F0FF     { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
 #define MASK_RRD_FE0FF    { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 }
 #define MASK_RRE_00       { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 }
@@ -810,6 +812,7 @@ const struct s390_opcode s390_opformats[] =
   { "ril_c",OP8(0x00LL), MASK_RIL_UP,	   INSTR_RIL_UP,      3,  2, 256, NULL },
   { "ris",  OP8(0x00LL), MASK_RIS_RURDI,   INSTR_RIS_RURDI,   2,  6, 256, NULL },
   { "rr",   OP8(0x00LL), MASK_RR_RR,	   INSTR_RR_RR,       3,  0, 256|1, NULL },
+  { "rrd",  OP8(0x00LL), MASK_RRD_R0RR,	   INSTR_RRD_R0RR,    3,  0, 256, NULL },
   { "rre",  OP8(0x00LL), MASK_RRE_RR,	   INSTR_RRE_RR,      3,  0, 256, NULL },
   { "rrf",  OP8(0x00LL), MASK_RRF_RURR,	   INSTR_RRF_RURR,    3,  0, 256, NULL },
   { "rrs",  OP8(0x00LL), MASK_RRS_RRRDU,   INSTR_RRS_RRRDU,   2,  6, 256, NULL },


More information about the Binutils-cvs mailing list