[PATCH v2 43/47] s390: Add .insn pseudo-mnemonics vrr_a/b/c/d/e/f/g/h/i/j/k

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


History of instruction format VRR:
- VRR-a/b/c/d/e/f got initially introduced with IBM z13. [1]
- VRR-g/h/i got introduced with IBM z14. [2]
- VRR-i got added an optional M4 field with IBM z15. [3]
- VRR-j/k got introduced with IBM z16. [4]
- VRR-g got added an optional I2 field with IBM z17. [5]

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-10, IBM z13,
     https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr010.pdf

[2]: IBM z/Architecture Principles of Operation, SA22-7832-11, IBM z14,
     https://publibfp.dhe.ibm.com/epubs/pdf/dz9zr011.pdf

[3]: IBM z/Architecture Principles of Operation, SA22-7832-12, IBM z15,
     https://publibfp.dhe.ibm.com/epubs/pdf/a227832c.pdf

[4]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16,
     https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf

[5]: 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 (s390_opformats): Add pseudo-mnemonics vrr_a,
	vrr_b, vrr_c, vrr_d, vrr_e, vrr_f, vrr_g, vrr_h, vrr_i, vrr_j,
	and vrr_k.

gas/testsuite/
	* gas/s390/zarch-operands.d: Add tests for .insn vrr_a, vrr_b,
	vrr_c, vrr_d, vrr_e, vrr_f, vrr_g, vrr_h, vrr_i, vrr_j, and
	vrr_k.
	* gas/s390/zarch-operands.s: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---

Notes (jremus):
    Changes in v2:
    - Correct vrr_a/b/c/d/e/f/g/h/i/j/k mode to z/Architecture (2).
      (Andreas)
    - Reword commit message to no longer claim the minimum architecture/CPU
      level would be enforced. (Andreas)

 gas/testsuite/gas/s390/zarch-operands.d | 37 +++++++++++++++++++++++++
 gas/testsuite/gas/s390/zarch-operands.s | 26 +++++++++++++++++
 opcodes/s390-opc.c                      | 11 ++++++++
 3 files changed, 74 insertions(+)

diff --git a/gas/testsuite/gas/s390/zarch-operands.d b/gas/testsuite/gas/s390/zarch-operands.d
index 6223320e4102..556570205c71 100644
--- a/gas/testsuite/gas/s390/zarch-operands.d
+++ b/gas/testsuite/gas/s390/zarch-operands.d
@@ -180,4 +180,41 @@ Disassembly of section .text:
 .*:	e7 12 30 37 40 88 [	 ]*veval	%v1,%v2,%v3,%v4,55
 # VRI-l
 .*:	e6 01 28 23 50 7f [	 ]*vtz	%v1,%v2,33333
+# VRR-a
+.*:	e7 12 00 54 30 c3 [	 ]*vcdgb	%v1,%v2,4,5
+.*:	e7 12 00 04 30 c3 [	 ]*vcdgb	%v1,%v2,4,0
+.*:	e7 12 00 00 30 c3 [	 ]*vcdgb	%v1,%v2,0,0
+.*:	e7 12 00 00 00 c3 [	 ]*vcfps	%v1,%v2,0,0,0
+# VRR-b
+.*:	e7 12 30 50 40 97 [	 ]*vpks	%v1,%v2,%v3,4,5
+.*:	e7 12 30 00 40 97 [	 ]*vpks	%v1,%v2,%v3,4,0
+.*:	e7 12 30 00 00 97 [	 ]*vpks	%v1,%v2,%v3,0,0
+# VRR-c
+.*:	e7 12 30 65 40 e8 [	 ]*vfce	%v1,%v2,%v3,4,5,6
+.*:	e7 12 30 05 40 e8 [	 ]*vfce	%v1,%v2,%v3,4,5,0
+.*:	e7 12 30 00 40 e8 [	 ]*vfce	%v1,%v2,%v3,4,0,0
+.*:	e7 12 30 00 00 e8 [	 ]*vfce	%v1,%v2,%v3,0,0,0
+# VRR-d
+.*:	e7 12 35 60 40 b8 [	 ]*vmsl	%v1,%v2,%v3,%v4,5,6
+.*:	e7 12 35 00 40 b8 [	 ]*vmsl	%v1,%v2,%v3,%v4,5,0
+.*:	e7 12 30 00 40 b8 [	 ]*vmsl	%v1,%v2,%v3,%v4,0,0
+# VRR-e
+.*:	e7 12 36 05 40 8f [	 ]*vfma	%v1,%v2,%v3,%v4,5,6
+.*:	e7 12 30 05 40 8f [	 ]*vfma	%v1,%v2,%v3,%v4,5,0
+.*:	e7 12 30 00 40 8f [	 ]*vfma	%v1,%v2,%v3,%v4,0,0
+# VRR-f
+.*:	e7 12 30 00 00 62 [	 ]*vlvgp	%v1,%r2,%r3
+# VRR-g
+.*:	e6 01 05 6c e0 5f [	 ]*vtp	%v1,22222
+.*:	e6 01 00 00 00 5f [	 ]*vtp	%v1
+# VRR-h
+.*:	e6 01 20 30 00 77 [	 ]*vcp	%v1,%v2,3
+.*:	e6 01 20 00 00 77 [	 ]*vcp	%v1,%v2,0
+# VRR-i
+.*:	e6 12 00 34 00 50 [	 ]*vcvb	%r1,%v2,3,4
+.*:	e6 12 00 30 00 50 [	 ]*vcvb	%r1,%v2,3
+# VRR-j
+.*:	e6 12 30 40 00 7d [	 ]*vcsph	%v1,%v2,%v3,4
+# VRR-k
+.*:	e6 12 00 30 00 4e [	 ]*vcvbq	%v1,%v2,3
 #?.*:	07 07 [	 ]*nopr	%r7
diff --git a/gas/testsuite/gas/s390/zarch-operands.s b/gas/testsuite/gas/s390/zarch-operands.s
index 2198a210283b..18867896e7d7 100644
--- a/gas/testsuite/gas/s390/zarch-operands.s
+++ b/gas/testsuite/gas/s390/zarch-operands.s
@@ -92,3 +92,29 @@ foo:
 	.insn vri_j,0xe6000000004a,%v1,%v2,33,4		# vcvdq %v1,%v2,33,4
 	.insn vri_k,0xe70000000088,%v1,%v2,%v3,%v4,55	# veval %v1,%v2,%v3,%v4,55
 	.insn vri_l,0xe6000000007f,%v1,%v2,33333	# vtz %v1,%v2,33333
+	.insn vrr_a,0xe700000000c3,%v1,%v2,3,4,5	# vcfps %v1,%v2,3,4,5
+	.insn vrr_a,0xe700000000c3,%v1,%v2,3,4		# vcfps %v1,%v2,3,4
+	.insn vrr_a,0xe700000000c3,%v1,%v2,3		# vcfps %v1,%v2,3
+	.insn vrr_a,0xe700000000c3,%v1,%v2		# vcfps %v1,%v2
+	.insn vrr_b,0xe70000000097,%v1,%v2,%v3,4,5	# vpks %v1,%v2,%v3,4,5
+	.insn vrr_b,0xe70000000097,%v1,%v2,%v3,4	# vpks %v1,%v2,%v3,4
+	.insn vrr_b,0xe70000000097,%v1,%v2,%v3		# vpks %v1,%v2,%v3
+	.insn vrr_c,0xe700000000e8,%v1,%v2,%v3,4,5,6	# vfce %v1,%v2,%v3,4,5,6
+	.insn vrr_c,0xe700000000e8,%v1,%v2,%v3,4,5	# vfce %v1,%v2,%v3,4,5
+	.insn vrr_c,0xe700000000e8,%v1,%v2,%v3,4	# vfce %v1,%v2,%v3,4
+	.insn vrr_c,0xe700000000e8,%v1,%v2,%v3		# vfce %v1,%v2,%v3
+	.insn vrr_d,0xe700000000b8,%v1,%v2,%v3,%v4,5,6	# vmsl %v1,%v2,%v3,%v4,5,6
+	.insn vrr_d,0xe700000000b8,%v1,%v2,%v3,%v4,5	# vmsl %v1,%v2,%v3,%v4,5
+	.insn vrr_d,0xe700000000b8,%v1,%v2,%v3,%v4	# vmsl %v1,%v2,%v3,%v4
+	.insn vrr_e,0xe7000000008f,%v1,%v2,%v3,%v4,5,6	# vfma %v1,%v2,%v3,%v4,5,6
+	.insn vrr_e,0xe7000000008f,%v1,%v2,%v3,%v4,5	# vfma %v1,%v2,%v3,%v4,5
+	.insn vrr_e,0xe7000000008f,%v1,%v2,%v3,%v4	# vfma %v1,%v2,%v3,%v4
+	.insn vrr_f,0xe70000000062,%v1,%r2,%r3		# vlvgp %v1,%r2,%r3
+	.insn vrr_g,0xe6000000005f,%v1,22222		# vtp %v1,22222
+	.insn vrr_g,0xe6000000005f,%v1			# vtp %v1
+	.insn vrr_h,0xe60000000077,%v1,%v2,3		# vcp %v1,%v2,3
+	.insn vrr_h,0xe60000000077,%v1,%v2		# vcp %v1,%v2
+	.insn vrr_i,0xe60000000050,%r1,%v2,3,4		# vcvb %r1,%v2,3,4
+	.insn vrr_i,0xe60000000050,%r1,%v2,3		# vcvb %r1,%v2,3
+	.insn vrr_j,0xe6000000007d,%v1,%v2,%v3,4	# vcsph %v1,%v2,%v3,4
+	.insn vrr_k,0xe6000000004e,%v1,%v2,3		# vcvbq %v1,%v2,3
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index e8fae64a02d3..d455d28348b8 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -882,6 +882,17 @@ const struct s390_opcode s390_opformats[] =
   { "vri_k",OP8(0x00LL), MASK_VRI_VVV0UV,  INSTR_VRI_VVV0UV,  2, 13, 256, NULL },
   { "vri_l",OP8(0x00LL), MASK_VRI_0VVU,	   INSTR_VRI_0VVU,    2, 13, 256, NULL },
   { "vrr",  OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 2,  9, 256, NULL },
+  { "vrr_a",OP8(0x00LL), MASK_VRR_VV0UUU,  INSTR_VRR_VV0UUU,  2,  9, 256|3, NULL },
+  { "vrr_b",OP8(0x00LL), MASK_VRR_VVV0U0U, INSTR_VRR_VVV0U0U, 2,  9, 256|2, NULL },
+  { "vrr_c",OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 2,  9, 256|3, NULL },
+  { "vrr_d",OP8(0x00LL), MASK_VRR_VVVUU0V, INSTR_VRR_VVVUU0V, 2,  9, 256|2, NULL },
+  { "vrr_e",OP8(0x00LL), MASK_VRR_VVVU0UV, INSTR_VRR_VVVU0UV, 2,  9, 256|2, NULL },
+  { "vrr_f",OP8(0x00LL), MASK_VRR_VRR,	   INSTR_VRR_VRR,     2,  9, 256, NULL },
+  { "vrr_g",OP8(0x00LL), MASK_VRR_0V0U,	   INSTR_VRR_0V0U,    2, 10, 256|1, NULL },
+  { "vrr_h",OP8(0x00LL), MASK_VRR_0VV0U,   INSTR_VRR_0VV0U,   2, 10, 256|1, NULL },
+  { "vrr_i",OP8(0x00LL), MASK_VRR_RV0UU,   INSTR_VRR_RV0UU,   2, 10, 256|1, NULL },
+  { "vrr_j",OP8(0x00LL), MASK_VRR_VVV0U0,  INSTR_VRR_VVV0U0,  2, 12, 256, NULL },
+  { "vrr_k",OP8(0x00LL), MASK_VRR_VV0U2,   INSTR_VRR_VV0U2,   2, 12, 256, NULL },
   { "vrs",  OP8(0x00LL), MASK_VRS_RVRDU,   INSTR_VRS_RVRDU,   2,  9, 256, NULL },
   { "vrv",  OP8(0x00LL), MASK_VRV_VVXRDU,  INSTR_VRV_VVXRDU,  2,  9, 256, NULL },
   { "vrx",  OP8(0x00LL), MASK_VRX_VRRDU,   INSTR_VRX_VRRDU,   2,  9, 256, NULL },
-- 
2.53.0



More information about the Binutils mailing list