[binutils-gdb] s390: Add .insn pseudo-mnemonics ril_a/b/c

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


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

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

    s390: Add .insn pseudo-mnemonics ril_a/b/c
    
    History of instruction format RIL:
    - RIL-b/c got initially introduced as RIL with IBM z900. [1, 2]
    - RIL-a got introduced with IBM z9-109. [3, 4]
    
    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 test for non-standard RIL .insn pseudo-mnemonic rilu.
    
    [1]: IBM z/Architecture Principles of Operation, SA22-7832-00, IBM z900,
         https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr000.pdf
    
    [2]: IBM z/Architecture Principles of Operation, SA22-7832-01,
         https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr001.pdf
    
    [3]: IBM z/Architecture Principles of Operation, SA22-7832-03,
         https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr003.pdf
    
    [4]: IBM z/Architecture Principles of Operation, SA22-7832-04, IBM z9,
         https://publibfp.dhe.ibm.com/epubs/pdf/a2278324.pdf
    
    opcodes/
            * s390-opc.c (s390_opformats): Add pseudo-mnemonics ril_a,
            ril_b, and ril_c.
    
    gas/testsuite/
            * gas/s390/zarch-operands.d: Add tests for .insn ril, rilu,
            ril_a, ril_b, and ril_c.
            * gas/s390/zarch-operands.s: Likewise.
    
    Signed-off-by: Jens Remus <jremus@linux.ibm.com>

Diff:
---
 gas/testsuite/gas/s390/zarch-operands.d | 8 ++++++++
 gas/testsuite/gas/s390/zarch-operands.s | 6 +++++-
 opcodes/s390-opc.c                      | 3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index bca4a0bdb39..8027d5cbf2a 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -43,8 +43,16 @@ Disassembly of section .text:
 .*:	ec 12 03 04 05 54 [	 ]*rnsbg	%r1,%r2,3,4,5
 # RIE-g
 .*:	ec 1f ff ff 00 42 [	 ]*lochi	%r1,-1,15
+# RIL
  *([\da-f]+):	c0 e5 00 00 00 00 [	 ]*brasl	%r14,\1 <foo\+0x\1>
 .*: R_390_PC32DBL	test_ril\+0x2
+.*:	c2 19 00 00 00 01 [	 ]*afi	%r1,1
+# RIL-a
+.*:	c2 19 ff ff ff ff [	 ]*afi	%r1,-1
+# RIL-b
+ *([\da-f]+):	c0 e5 00 00 00 00 [	 ]*brasl	%r14,\1 <foo\+0x\1>
+# RIL-c
+ *([\da-f]+):	c0 f4 00 00 00 00 [	 ]*jg	\1 <foo\+0x\1>
 .*:	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 57ec87e610c..51e194c56cc 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -16,6 +16,10 @@ foo:
 	.insn rie_e,0xec0000000044,%r1,.,%r3		# brxhg %r1,%r3,.
 	.insn rie_f,0xec0000000054,%r1,%r2,3,4,5	# rnsbg %r1,%r2,3,4,5
 	.insn rie_g,0xec0000000042,%r1,-1,15		# lochi %r1,-1,15
-	.insn ril,0xc00500000000,%r14,test_ril
+	.insn ril,0xc00500000000,%r14,test_ril		# brasl %r14,test_ril
+	.insn rilu,0xc20900000000,%r1,1			# afi %r1,1
+	.insn ril_a,0xc20900000000,%r1,-1		# afi %r1,-1
+	.insn ril_b,0xc00500000000,%r14,.		# brasl %r14,.
+	.insn ril_c,0xc00400000000,0b1111,.		# brcl 0b1111,.
 	.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 2c6405d2a51..840f9535892 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -805,6 +805,9 @@ const struct s390_opcode s390_opformats[] =
   { "rie_g",OP8(0x00LL), MASK_RIE_RUU0,	   INSTR_RIE_RUU0,    2,  9, 256, NULL },
   { "ril",  OP8(0x00LL), MASK_RIL_RP,	   INSTR_RIL_RP,      3,  2, 256, NULL },
   { "rilu", OP8(0x00LL), MASK_RIL_RU,	   INSTR_RIL_RU,      2,  4, 256, NULL },
+  { "ril_a",OP8(0x00LL), MASK_RIL_RU,	   INSTR_RIL_RU,      2,  4, 256, NULL },
+  { "ril_b",OP8(0x00LL), MASK_RIL_RP,	   INSTR_RIL_RP,      3,  2, 256, NULL },
+  { "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, NULL },
   { "rre",  OP8(0x00LL), MASK_RRE_RR,	   INSTR_RRE_RR,      3,  0, 256, NULL },


More information about the Binutils-cvs mailing list