[PATCH v2 37/47] s390: Make I2 operand optional in .insn pseudo-mnemonic siy

Jens Remus jremus@linux.ibm.com
Fri Nov 6 15:57:27 GMT 2026


The SIY instruction format has an optional I2 field.  Make the I2
operand in the .insn pseudo-mnemonic siy optional.

opcodes/
	* s390-opc.c (s390_opformats): Make I2 operand optional in
	pseudo-mnemonic siy.

gas/
	* doc/c-s390.texi (s390 Formats): Document SIY operand I2 as
	optional.

gas/testsuite/
	* gas/s390/zarch-operands.d: Add test for .insn siy.
	* gas/s390/zarch-operands.s: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
 gas/doc/c-s390.texi                     | 2 +-
 gas/testsuite/gas/s390/zarch-operands.d | 3 +++
 gas/testsuite/gas/s390/zarch-operands.s | 2 ++
 opcodes/s390-opc.c                      | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi
index a3954173da4a..0d80bb525e33 100644
--- a/gas/doc/c-s390.texi
+++ b/gas/doc/c-s390.texi
@@ -652,7 +652,7 @@ with the @samp{.insn} pseudo directive:
 0         8         16   20            31
 @end verbatim
 
-@item SIY format: <insn> D1(B1),I2
+@item SIY format: <insn> D1(B1)[,I2]
 @verbatim
 +---------+---------+----+--------------+---------+---------+
 | OpCode  |   I2    | B1 |     DL1      |   DH1   | OpCode  |
diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 68d44836c5dc..185d9cd69015 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -131,5 +131,8 @@ Disassembly of section .text:
 .*:	93 00 10 6f [	 ]*ts	111\(%r1\)
 # SIL
 .*:	e5 44 10 6f 56 ce [	 ]*mvhhi	111\(%r1\),22222
+# SIY
+.*:	eb 16 1b 67 02 7a [	 ]*agsi	11111\(%r1\),22
+.*:	eb 00 1b 67 02 71 [	 ]*lpswey	11111\(%r1\)
 .*:	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 acdec8b20267..18ea348ad017 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -66,4 +66,6 @@ foo:
 	.insn si,0x95000000,111(%r1),22			# cli 111(%r1),22
 	.insn si,0x93000000,111(%r1)			# ts 111(%r1)
 	.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 ssf,0xc80000000000,1(%r2),3(%r4),%r5
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index 0079f02b8696..8e38dfdcaa7a 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -855,7 +855,7 @@ const struct s390_opcode s390_opformats[] =
   { "s",    OP8(0x00LL), MASK_S_RD,	   INSTR_S_RD,	      3,  0, 256|1, NULL },
   { "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, NULL },
+  { "siy",  OP8(0x00LL), MASK_SIY_URD,	   INSTR_SIY_URD,     2,  3, 256|1, 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