[PATCH v2 13/47] s390: Add .insn pseudo-mnemonic i
Jens Remus
jremus@linux.ibm.com
Fri Nov 6 15:57:03 GMT 2026
Add instruction format I. [1, 3] Add it as .insn pseudo-mnemonic i.
Change the svc instruction to use this format to align it to
specification. [2] The latter is a purely mechanical change.
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-02, IBM z990,
https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr002.pdf
[2]: IBM z/Architecture Principles of Operation, SA22-7832-03,
https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr003.pdf
[3]: IBM z/Architecture Principles of Operation, SA22-7832-14, IBM z17,
https://www.ibm.com/docs/en/module_1678991624569/pdf/SA22-7832-14.pdf
opcodes/
* s390-opc.c (INSTR_I_U, MASK_I_U): Define insn format I_U.
(INSTR_RR_U0, MASK_RR_U0): Remove insn format RR_U0.
(s390_opformats): Add pseudo-mnemonic i.
* s390-opc.txt (svc): Use insn format I_U instead of RR_U0.
gas/
* doc/c-s390.texi (s390 Formats): Document instruction format I.
gas/testsuite/
* gas/s390/esa-operands.d: Add test for .insn i.
* gas/s390/esa-operands.s: Likewise.
* gas/s390/zarch-operands.d: Likewise.
* gas/s390/zarch-operands.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
Notes (jremus):
Changes in v2:
- Reword commit message.
gas/doc/c-s390.texi | 8 ++++++++
gas/testsuite/gas/s390/esa-operands.d | 2 ++
gas/testsuite/gas/s390/esa-operands.s | 1 +
gas/testsuite/gas/s390/zarch-operands.d | 2 ++
gas/testsuite/gas/s390/zarch-operands.s | 1 +
opcodes/s390-opc.c | 5 +++--
opcodes/s390-opc.txt | 2 +-
7 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index 53fe7128b362..ccc5fdf51114 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -446,6 +446,14 @@ with the @samp{.insn} pseudo directive:
0 15
@end verbatim
+@item I format: <insn> I1
+@verbatim
++---------+---------+
+| OpCode | I1 |
++---------+---------+
+0 8 15
+@end verbatim
+
@item RI format: <insn> R1,I2
@verbatim
+---------+----+----+-------------------+
diff --git a/gas/testsuite/gas/s390/esa-operands.d b/gas/testsuite/gas/s390/esa-operands.d
index 2c4f6f6e90d2..ba1f6e035905 100644
--- a/gas/testsuite/gas/s390/esa-operands.d
+++ b/gas/testsuite/gas/s390/esa-operands.d
@@ -8,6 +8,8 @@ Disassembly of section .text:
.* <foo>:
# E
.*: 01 01 [ ]*pr
+# I
+.*: 0a 01 [ ]*svc 1
.*: a7 1a 80 01 [ ]*ahi %r1,-32767
.*: 18 12 [ ]*lr %r1,%r2
.*: b2 5e 00 12 [ ]*srst %r1,%r2
diff --git a/gas/testsuite/gas/s390/esa-operands.s b/gas/testsuite/gas/s390/esa-operands.s
index a0efe857c1c4..8169852b3116 100644
--- a/gas/testsuite/gas/s390/esa-operands.s
+++ b/gas/testsuite/gas/s390/esa-operands.s
@@ -1,6 +1,7 @@
.text
foo:
.insn e,0x0101 # pr
+ .insn i,0x0a00,1 # svc 1
.insn ri,0xa70a0000,%r1,-32767
.insn rr,0x1800,%r1,%r2
.insn rre,0xb25e0000,%r1,%r2
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 1f8d2177eac2..3ee0dbbf9898 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -8,6 +8,8 @@ Disassembly of section .text:
.* <foo>:
# E
.*: 01 01 [ ]*pr
+# I
+.*: 0a 01 [ ]*svc 1
*([\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 3817036313a3..e2e7db3d8b4f 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -1,6 +1,7 @@
.text
foo:
.insn e,0x0101 # pr
+ .insn i,0x0a00,1 # svc 1
.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 3db408780466..679024dbb137 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -306,6 +306,7 @@ unused_s390_operands_static_asserts (void)
The instruction format is: INSTR_SS_LLRDRD / MASK_SS_LLRDRD. */
#define INSTR_E 2, { 0,0,0,0,0,0 } /* e.g. pr */
+#define INSTR_I_U 2, { U8_8,0,0,0,0,0 } /* e.g. svc */
#define INSTR_IE_UU 4, { U4_24,U4_28,0,0,0,0 } /* e.g. niai */
#define INSTR_MII_UPP 6, { U4_8,J12_12,J24_24 } /* e.g. bprp */
#define INSTR_RIE_RRP 6, { R_8,R_12,J16_16,0,0,0 } /* e.g. brxhg */
@@ -408,7 +409,6 @@ unused_s390_operands_static_asserts (void)
#define INSTR_RR_RR 2, { R_8,R_12,0,0,0,0 } /* e.g. lr */
#define INSTR_RR_RER 2, { RE_8,R_12,0,0,0,0 } /* e.g. dr */
#define INSTR_RR_RERE 2, { RE_8,RE_12,0,0,0,0 } /* e.g. clcl */
-#define INSTR_RR_U0 2, { U8_8, 0,0,0,0,0 } /* e.g. svc */
#define INSTR_RR_UR 2, { U4_8,R_12,0,0,0,0 } /* e.g. bcr */
#define INSTR_RRS_RRRDU 6, { R_8,R_12,U4_32,D_20,B_16 } /* e.g. crb */
#define INSTR_RRS_RRRD0 6, { R_8,R_12,D_20,B_16,0 } /* e.g. crbne */
@@ -541,6 +541,7 @@ unused_s390_operands_static_asserts (void)
#define INSTR_VSI_URDV 6, { V_32,D_20,B_16,U8_8,0,0 } /* e.g. vlrl */
#define MASK_E { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
+#define MASK_I_U { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_IE_UU { 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 }
#define MASK_MII_UPP { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RIE_RRP { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
@@ -643,7 +644,6 @@ unused_s390_operands_static_asserts (void)
#define MASK_RR_RR { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RR_RER { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RR_RERE { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
-#define MASK_RR_U0 { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RR_UR { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define MASK_RRS_RRRDU { 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff }
#define MASK_RRS_RRRD0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff }
@@ -782,6 +782,7 @@ const struct s390_opcode s390_opformats[] =
{
/*NAME, OPCODE, MASK, INSTR, MODE,CPU,FLAG, DESCRIPTION*/
{ "e", OP8(0x00LL), MASK_E, INSTR_E, 3, 0, 256, NULL },
+ { "i", OP8(0x00LL), MASK_I_U, INSTR_I_U, 3, 0, 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 },
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
index bd6df3ff0fba..1efe385b243e 100644
--- a/opcodes/s390-opc.txt
+++ b/opcodes/s390-opc.txt
@@ -223,7 +223,7 @@ b234 stsch S_RD "store subchannel" g5 esa,zarch
b246 stura RRE_RR "store using real address" g5 esa,zarch
7f su RX_FRRD "subtract unnormalized (short)" g5 esa,zarch
3f sur RR_FF "subtract unnormalized (short)" g5 esa,zarch
-0a svc RR_U0 "supervisor call" g5 esa,zarch
+0a svc I_U "supervisor call" g5 esa,zarch
6f sw RX_FRRD "subtract unnormalized (long)" g5 esa,zarch
2f swr RR_FF "subtract unnormalized (long)" g5 esa,zarch
37 sxr RR_FEFE "subtract normalized (ext.)" g5 esa,zarch
--
2.53.0
More information about the Binutils
mailing list