public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] aarch64: Fix PSEL opcode mask
@ 2023-03-30 10:10 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2023-03-30 10:10 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d346e1aafd10442d85fc149a663bb298cebc0fc7

commit d346e1aafd10442d85fc149a663bb298cebc0fc7
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Thu Mar 30 11:09:02 2023 +0100

    aarch64: Fix PSEL opcode mask
    
    The opcode mask for PSEL was missing some bits, which meant
    that some upcoming SME2 opcodes would be misinterpreted as PSELs.

Diff:
---
 gas/testsuite/gas/aarch64/sme-9.d | 3 +++
 gas/testsuite/gas/aarch64/sme-9.s | 5 +++++
 opcodes/aarch64-tbl.h             | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gas/testsuite/gas/aarch64/sme-9.d b/gas/testsuite/gas/aarch64/sme-9.d
index ef314c61451..9a6175c3906 100644
--- a/gas/testsuite/gas/aarch64/sme-9.d
+++ b/gas/testsuite/gas/aarch64/sme-9.d
@@ -71,3 +71,6 @@ Disassembly of section \.text:
   f4:	44cbc544 	uclamp	z4.d, z10.d, z11.d
   f8:	25277c61 	psel	p1, p15, p3.b\[w15, 0\]
   fc:	252778a2 	psel	p2, p14, p5.b\[w15, 0\]
+ 100:	25244200 	\.inst	0x25244200 ; undefined
+ 104:	25244010 	\.inst	0x25244010 ; undefined
+ 108:	25244210 	\.inst	0x25244210 ; undefined
diff --git a/gas/testsuite/gas/aarch64/sme-9.s b/gas/testsuite/gas/aarch64/sme-9.s
index be8511fe3df..495a7f9fbf0 100644
--- a/gas/testsuite/gas/aarch64/sme-9.s
+++ b/gas/testsuite/gas/aarch64/sme-9.s
@@ -84,3 +84,8 @@ foo .req p1
 bar .req w15
 psel foo, p15, p3.b[w15, 0]
 psel p2, p14, p5.b[bar, 0]
+
+// These were previously incorrectly decoded as PSELs.
+.inst 0x25244200
+.inst 0x25244010
+.inst 0x25244210
diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h
index 69703650471..96e6c136282 100644
--- a/opcodes/aarch64-tbl.h
+++ b/opcodes/aarch64-tbl.h
@@ -5275,7 +5275,7 @@ const struct aarch64_opcode aarch64_opcode_table[] =
   SME_INSNC ("revd", 0x52e8000, 0xffffe000, sme_misc, 0, OP3 (SVE_Zd, SVE_Pg3, SVE_Zn), OP_SVE_QMQ, 0, C_SCAN_MOVPRFX, 0),
   SME_INSNC ("sclamp", 0x4400c000, 0xff20fc00, sve_size_bhsd, 0, OP3 (SVE_Zd, SVE_Zn, SVE_Zm_16), OP_SVE_VVV_BHSD, 0, C_SCAN_MOVPRFX, 0),
   SME_INSNC ("uclamp", 0x4400c400, 0xff20fc00, sve_size_bhsd, 0, OP3 (SVE_Zd, SVE_Zn, SVE_Zm_16), OP_SVE_VVV_BHSD, 0, C_SCAN_MOVPRFX, 0),
-  SME_INSN ("psel", 0x25204000, 0xff20c000, sme_misc, 0, OP3 (SVE_Pd, SVE_Pg4_10, SME_PnT_Wm_imm), OP_SVE_NN_BHSD, 0, 0),
+  SME_INSN ("psel", 0x25204000, 0xff20c210, sme_misc, 0, OP3 (SVE_Pd, SVE_Pg4_10, SME_PnT_Wm_imm), OP_SVE_NN_BHSD, 0, 0),
 
   /* SIMD Dot Product (optional in v8.2-A).  */
   DOT_INSN ("udot", 0x2e009400, 0xbf20fc00, dotproduct, OP3 (Vd, Vn, Vm), QL_V3DOT, F_SIZEQ),

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-30 10:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 10:10 [binutils-gdb] aarch64: Fix PSEL opcode mask Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).