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

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


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

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

    s390: Add .insn pseudo-mnemonic mii
    
    Instruction format MII got introduced with IBM zEC12. [1]
    
    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-09, IBM zEC12,
         https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr009.pdf
    
    opcodes/
            * s390-opc.c (s390_opformats): Add pseudo-mnemonic mii.
    
    gas/
            * doc/c-s390.texi (s390 Formats): Document instruction format MII.
    
    gas/testsuite/
            * gas/s390/zarch-operands.d: Add test for .insn mii.
            * 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 | 4 ++++
 gas/testsuite/gas/s390/zarch-operands.s | 1 +
 opcodes/s390-opc.c                      | 1 +
 4 files changed, 14 insertions(+)

diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index f870204fe30..9b9c058577b 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -462,6 +462,14 @@ with the @samp{.insn} pseudo directive:
 0                   16        24   28  31
 @end verbatim
 
+@item MII format: <insn> M1,RI2,RI3
+@verbatim
++---------+----+--------------+-----------------------------+
+| OpCode  | M1 |      RI2     |             RI3             |
++---------+----+--------------+-----------------------------+
+0         8    12             24                           47
+@end verbatim
+
 @item RI format: <insn> R1,I2
 @verbatim
 +---------+----+----+-------------------+
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 20a84e951a5..60fe39e55b7 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -12,6 +12,10 @@ Disassembly of section .text:
 .*:	0a 01 [	 ]*svc	1
 # IE
 .*:	b2 fa 00 12 [	 ]*niai	1,2
+# MII
+ *([\da-f]+):	c5 10 00 00 00 00 [	 ]*bprp	1,\1 <foo\+0x\1>,\1 <foo\+0x\1>
+.*: R_390_PC12DBL	test_mii\+0x1
+.*: R_390_PC24DBL	test_mii\+0x3
  *([\da-f]+):	ec 12 00 00 00 45 [	 ]*brxlg	%r1,%r2,\1 <foo\+0x\1>
 .*: R_390_PC16DBL	test_rie\+0x2
  *([\da-f]+):	c0 e5 00 00 00 00 [	 ]*brasl	%r14,\1 <foo\+0x\1>
diff --git a/gas/testsuite/gas/s390/zarch-operands.s b/gas/testsuite/gas/s390/zarch-operands.s
index afa2325a5a5..e2439f5a8a6 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -3,6 +3,7 @@ foo:
 	.insn e,0x0101					# pr
 	.insn i,0x0a00,1				# svc 1
 	.insn ie,0xb2fa0000,1,2				# niai 1,2
+	.insn mii,0xc50000000000,1,test_mii,test_mii	# bprp 1,test_mii,test_mii
 	.insn rie,0xec0000000045,%r1,%r2,test_rie
 	.insn ril,0xc00500000000,%r14,test_ril
 	.insn rse,0xeb000000000d,%r1,%r2,3(%r4)
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index 3dd32c954d6..839f43de69d 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -784,6 +784,7 @@ const struct s390_opcode s390_opformats[] =
   { "e",    OP8(0x00LL), MASK_E,	   INSTR_E,	      3,  0, 256, NULL },
   { "i",    OP8(0x00LL), MASK_I_U,	   INSTR_I_U,	      3,  0, 256, NULL },
   { "ie",   OP8(0x00LL), MASK_IE_UU,	   INSTR_IE_UU,	      2,  8, 256, NULL },
+  { "mii",  OP8(0x00LL), MASK_MII_UPP,	   INSTR_MII_UPP,     2,  8, 256, NULL },
   { "ri",   OP8(0x00LL), MASK_RI_RI,	   INSTR_RI_RI,	      3,  0, 256, NULL },
   { "rie",  OP8(0x00LL), MASK_RIE_RRP,	   INSTR_RIE_RRP,     2,  2, 256, NULL },
   { "ril",  OP8(0x00LL), MASK_RIL_RP,	   INSTR_RIL_RP,      3,  2, 256, NULL },


More information about the Binutils-cvs mailing list