[PATCH v2 38/47] s390: Add .insn pseudo-mnemonic smi
Jens Remus
jremus@linux.ibm.com
Fri Nov 6 15:57:28 GMT 2026
Instruction format SMI 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 smi.
gas/
* doc/c-s390.texi (s390 Formats): Document instruction format
SMI.
gas/testsuite/
* gas/s390/zarch-operands.d: Add test for .insn smi.
* gas/s390/zarch-operands.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
Notes (jremus):
Changes in v2:
- Reword commit message to no longer claim the minimum architecture/CPU
level would be enforced. (Andreas)
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 | 1 +
4 files changed, 12 insertions(+)
diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index 0d80bb525e33..70ba2bd49dac 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -668,6 +668,14 @@ with the @samp{.insn} pseudo directive:
0 16 20 32 47
@end verbatim
+@item SMI format: <insn> M1,RI2,D3(B3)
+@verbatim
++---------+----+----+----+--------------+-------------------+
+| OpCode | M1 |////| B3 | D3 | RI2 |
++---------+----+----+----+--------------+-------------------+
+0 8 12 16 20 32 47
+@end verbatim
+
@item SS format: <insn> D1(R1,B1),D2(B2),R3
@verbatim
+---------+----+----+----+--------------+----+--------------+
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 185d9cd69015..bea809e3cfdd 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -134,5 +134,7 @@ Disassembly of section .text:
# SIY
.*: eb 16 1b 67 02 7a [ ]*agsi 11111\(%r1\),22
.*: eb 00 1b 67 02 71 [ ]*lpswey 11111\(%r1\)
+# SMI
+ *([\da-f]+): c7 10 31 4d 00 00 [ ]*bpp 1,\1 <foo\+0x\1>,333\(%r3\)
.*: 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 18ea348ad017..68389be557be 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -68,4 +68,5 @@ foo:
.insn sil,0xe54400000000,111(%r1),22222 # mvhhi 111(%r1),22222
.insn siy,0xeb000000007a,11111(%r1),22 # agsi 11111(%r1),22
.insn siy,0xeb0000000071,11111(%r1) # lpswey 11111(%r1)
+ .insn smi,0xc70000000000,1,.,333(%r3) # bpp 1,.,333(%r3)
.insn ssf,0xc80000000000,1(%r2),3(%r4),%r5
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index 8e38dfdcaa7a..343c528bd6a0 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -856,6 +856,7 @@ const struct s390_opcode s390_opformats[] =
{ "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3, 0, 256|1, NULL },
{ "sil", OP8(0x00LL), MASK_SIL_RDI, INSTR_SIL_RDI, 2, 6, 256, NULL },
{ "siy", OP8(0x00LL), MASK_SIY_URD, INSTR_SIY_URD, 2, 3, 256|1, NULL },
+ { "smi", OP8(0x00LL), MASK_SMI_U0RDP, INSTR_SMI_U0RDP, 2, 8, 256, NULL },
{ "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD, 3, 0, 256, NULL },
{ "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3, 0, 256, NULL },
{ "ssf", OP8(0x00LL), MASK_SSF_RRDRD, INSTR_SSF_RRDRD, 2, 4, 256, NULL },
--
2.53.0
More information about the Binutils
mailing list