[v1,05/12] aarch64: Add support for sve2p1 uzpq[1-2] instructions.

Message ID 20240704124045.306577-6-srinath.parvathaneni@arm.com
State New
Headers
Series aarch64: Add support for remaining sve2p1 instructions. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 fail Test failed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Srinath Parvathaneni July 4, 2024, 12:40 p.m. UTC
  This patch adds support for SVE2p1 "uzpq1" and "uzpq2" instructions, spec is
available here [1]
[1]: https://developer.arm.com/documentation/ddi0602/2024-03/SVE-Instructions?lang=en
---
 gas/testsuite/gas/aarch64/sve2p1-6-invalid.d |  2 +-
 gas/testsuite/gas/aarch64/sve2p1-6-invalid.l | 24 ++++++++++++++++++++
 gas/testsuite/gas/aarch64/sve2p1-6-invalid.s | 12 ++++++++++
 gas/testsuite/gas/aarch64/sve2p1-6.d         | 18 ++++++++++++++-
 gas/testsuite/gas/aarch64/sve2p1-6.s         | 18 +++++++++++++++
 opcodes/aarch64-tbl.h                        |  2 ++
 6 files changed, 74 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.d b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.d
index 1aa2b39f857..0971a587815 100644
--- a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.d
+++ b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.d
@@ -1,3 +1,3 @@ 
-#name: Test of illegal SVE2.1 TBLQ instruction.
+#name: Test of illegal SVE2.1 tblq, uzpq1 and uzpq2 instruction.
 #as: -march=armv9.4-a
 #error_output: sve2p1-6-invalid.l
diff --git a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.l b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.l
index 0fea3255db4..c784ca6c891 100644
--- a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.l
+++ b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.l
@@ -16,3 +16,27 @@ 
 .*: Info:    	tblq z0.h, {z31.h}, z0.h
 .*: Info:    	tblq z0.d, {z31.d}, z0.d
 .*: Error: expected an SVE vector register at operand 3 -- `tblq z0.b,{z0.b},{z31.b}'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq1 z0.s,{z0.b},z0.b'
+.*: Error: operand mismatch -- `uzpq1 z31.s,z0.b,z0.h'
+.*: Info:    did you mean this\?
+.*: Info:    	uzpq1 z31.b, z0.b, z0.b
+.*: Info:    other valid variant\(s\):
+.*: Info:    	uzpq1 z31.h, z0.h, z0.h
+.*: Info:    	uzpq1 z31.s, z0.s, z0.s
+.*: Info:    	uzpq1 z31.d, z0.d, z0.d
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq1 z0.s,{z0.s,z1.s},z0.s'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq1 z0.h,{z0.h-z1.h},z0.h'
+.*: Error: expected an SVE vector register at operand 1 -- `uzpq1 {z0.s},z31.s,z0.b'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq1 z0.b,{z0.b},{z31.b}'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq2 z0.s,{z0.b},z0.b'
+.*: Error: operand mismatch -- `uzpq2 z31.s,z0.b,z0.h'
+.*: Info:    did you mean this\?
+.*: Info:    	uzpq2 z31.b, z0.b, z0.b
+.*: Info:    other valid variant\(s\):
+.*: Info:    	uzpq2 z31.h, z0.h, z0.h
+.*: Info:    	uzpq2 z31.s, z0.s, z0.s
+.*: Info:    	uzpq2 z31.d, z0.d, z0.d
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq2 z0.s,{z0.s,z1.s},z0.s'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq2 z0.h,{z0.h-z1.h},z0.h'
+.*: Error: expected an SVE vector register at operand 1 -- `uzpq2 {z0.s},z31.s,z0.b'
+.*: Error: expected an SVE vector register at operand 2 -- `uzpq2 z0.b,{z0.b},{z31.b}'
diff --git a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.s b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.s
index 0f8300e385c..8a6df867726 100644
--- a/gas/testsuite/gas/aarch64/sve2p1-6-invalid.s
+++ b/gas/testsuite/gas/aarch64/sve2p1-6-invalid.s
@@ -4,3 +4,15 @@  tblq z0.s, {z0.s, z1.s}, z0.s
 tblq z0.s, {z0.s - z1.s}, z0.s
 tblq z0.s, {z31.s}, z0.b
 tblq z0.b, {z0.b}, {z31.b}
+uzpq1 z0.s, {z0.b}, z0.b
+uzpq1 z31.s, z0.b, z0.h
+uzpq1 z0.s, {z0.s, z1.s}, z0.s
+uzpq1 z0.h, {z0.h - z1.h}, z0.h
+uzpq1 {z0.s}, z31.s, z0.b
+uzpq1 z0.b, {z0.b}, {z31.b}
+uzpq2 z0.s, {z0.b}, z0.b
+uzpq2 z31.s, z0.b, z0.h
+uzpq2 z0.s, {z0.s, z1.s}, z0.s
+uzpq2 z0.h, {z0.h - z1.h}, z0.h
+uzpq2 {z0.s}, z31.s, z0.b
+uzpq2 z0.b, {z0.b}, {z31.b}
diff --git a/gas/testsuite/gas/aarch64/sve2p1-6.d b/gas/testsuite/gas/aarch64/sve2p1-6.d
index d146903c4a7..b36515f234c 100644
--- a/gas/testsuite/gas/aarch64/sve2p1-6.d
+++ b/gas/testsuite/gas/aarch64/sve2p1-6.d
@@ -1,4 +1,4 @@ 
-#name: Test of SVE2.1 TBLQ instruction.
+#name: Test of SVE2.1 tblq, uzpq1 and uzpq2 instruction.
 #as: -march=armv9.4-a
 #objdump: -dr
 
@@ -16,3 +16,19 @@ 
 .*:	44dffbff 	tblq	z31.d, {z31.d}, z31.d
 .*:	444ff945 	tblq	z5.h, {z10.h}, z15.h
 .*:	4487f861 	tblq	z1.s, {z3.s}, z7.s
+.*:	4400e800 	uzpq1	z0.b, z0.b, z0.b
+.*:	4400e81f 	uzpq1	z31.b, z0.b, z0.b
+.*:	44c0e800 	uzpq1	z0.d, z0.d, z0.d
+.*:	4400ebe0 	uzpq1	z0.b, z31.b, z0.b
+.*:	441fe800 	uzpq1	z0.b, z0.b, z31.b
+.*:	44dfebff 	uzpq1	z31.d, z31.d, z31.d
+.*:	448fe945 	uzpq1	z5.s, z10.s, z15.s
+.*:	4454e9ea 	uzpq1	z10.h, z15.h, z20.h
+.*:	4400ec00 	uzpq2	z0.b, z0.b, z0.b
+.*:	4400ec1f 	uzpq2	z31.b, z0.b, z0.b
+.*:	44c0ec00 	uzpq2	z0.d, z0.d, z0.d
+.*:	4400efe0 	uzpq2	z0.b, z31.b, z0.b
+.*:	441fec00 	uzpq2	z0.b, z0.b, z31.b
+.*:	44dfefff 	uzpq2	z31.d, z31.d, z31.d
+.*:	448fed45 	uzpq2	z5.s, z10.s, z15.s
+.*:	4454edea 	uzpq2	z10.h, z15.h, z20.h
diff --git a/gas/testsuite/gas/aarch64/sve2p1-6.s b/gas/testsuite/gas/aarch64/sve2p1-6.s
index d2a0ef5fedf..b8c6ed72a89 100644
--- a/gas/testsuite/gas/aarch64/sve2p1-6.s
+++ b/gas/testsuite/gas/aarch64/sve2p1-6.s
@@ -6,3 +6,21 @@  tblq z0.b, {z0.b}, z31.b
 tblq z31.d, {z31.d}, z31.d
 tblq z5.h, {z10.h}, z15.h
 tblq z1.s, {z3.s}, z7.s
+
+uzpq1 z0.b, z0.b, z0.b
+uzpq1 z31.b, z0.b, z0.b
+uzpq1 z0.d, z0.d, z0.d
+uzpq1 z0.b, z31.b, z0.b
+uzpq1 z0.b, z0.b, z31.b
+uzpq1 z31.d, z31.d, z31.d
+uzpq1 z5.s, z10.s, z15.s
+uzpq1 z10.h, z15.h, z20.h
+
+uzpq2 z0.b, z0.b, z0.b
+uzpq2 z31.b, z0.b, z0.b
+uzpq2 z0.d, z0.d, z0.d
+uzpq2 z0.b, z31.b, z0.b
+uzpq2 z0.b, z0.b, z31.b
+uzpq2 z31.d, z31.d, z31.d
+uzpq2 z5.s, z10.s, z15.s
+uzpq2 z10.h, z15.h, z20.h
diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h
index 56a6c9d6e82..7089f167552 100644
--- a/opcodes/aarch64-tbl.h
+++ b/opcodes/aarch64-tbl.h
@@ -6643,6 +6643,8 @@  const struct aarch64_opcode aarch64_opcode_table[] =
   SVE2p1_INSN("orqv",0x041c2000, 0xff3fe000, sve2_urqvs, 0, OP3 (Vd, SVE_Pg3, SVE_Zn), OP_SVE_vUS_BHSD_BHSD, F_OPD_SIZE, 0),
   SVE2p1_INSN("tblq",0x4400f800, 0xff20fc00, sve_size_bhsd, 0, OP3 (SVE_Zd, SVE_ZnxN, SVE_Zm_16), OP_SVE_VVV_BHSD, F_OD(1), 0),
   SVE2p1_INSNC("extq",0x05602400, 0xfff0fc00, sve_misc, 0, OP4 (SVE_Zd, SVE_Zd, SVE_Zm_5, SVE_UIMM4), OP_SVE_BBBU, 0, C_SCAN_MOVPRFX, 1),
+  SVE2p1_INSN("uzpq1",0x4400e800, 0xff20fc00, sve_size_bhsd, 0, OP3 (SVE_Zd, SVE_Zn, SVE_Zm_16), OP_SVE_VVV_BHSD, 0, 0),
+  SVE2p1_INSN("uzpq2",0x4400ec00, 0xff20fc00, sve_size_bhsd, 0, OP3 (SVE_Zd, SVE_Zn, SVE_Zm_16), OP_SVE_VVV_BHSD, 0, 0),
 
   SVE2p1_INSN("ld1q",0xc400a000, 0xffe0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_ZX), OP_SVE_QZD, F_OD (1), 0),
   SVE2p1_INSN("ld2q",0xa490e000, 0xfff0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RI_S4x2xVL), OP_SVE_QZU, F_OD (2), 0),