aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-10-30 12:12:24 +0100
committerJan Beulich <jbeulich@suse.com>2024-10-30 12:12:24 +0100
commitd0a9378d985b3fe7b52369ec7c64088f3171fdc9 (patch)
tree6cfe81f7024df0242da17aa8ce3642564d5c3e47 /gas/testsuite
parent0a81e17f765a4ae25532810b346545929a721317 (diff)
downloadbinutils-d0a9378d985b3fe7b52369ec7c64088f3171fdc9.zip
binutils-d0a9378d985b3fe7b52369ec7c64088f3171fdc9.tar.gz
binutils-d0a9378d985b3fe7b52369ec7c64088f3171fdc9.tar.bz2
x86/APX: squash REX prefix when REX2 is being emitted
We should not (silently) emit a REX prefix ahead of a REX2-encoded insn; such encodings are illegal. Best we can do is fold the REX bits into the REX2 prefix, and then zap the REX one from i.prefix[].
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/x86-64-apx-rex2.d4
-rw-r--r--gas/testsuite/gas/i386/x86-64-apx-rex2.s6
2 files changed, 10 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/x86-64-apx-rex2.d b/gas/testsuite/gas/i386/x86-64-apx-rex2.d
index e3cd534..0783f9b 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-rex2.d
+++ b/gas/testsuite/gas/i386/x86-64-apx-rex2.d
@@ -80,4 +80,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+:[ ]*d5 76 8d 7c 20 01 lea 0x1\(%r16,%r28,1\),%r31d
[ ]*[a-f0-9]+:[ ]*d5 12 8d 84 04 81 00 00 00 lea 0x81\(%r20,%r8,1\),%eax
[ ]*[a-f0-9]+:[ ]*d5 57 8d bc 04 81 00 00 00 lea 0x81\(%r28,%r8,1\),%r31d
+[ ]*[a-f0-9]+:[ ]*d5 14 f7 14 24 \{rex2 0x14\} notl \(%r20\)
+[ ]*[a-f0-9]+:[ ]*d5 12 f7 14 24 notl \(%r20,%r12,1\)
+[ ]*[a-f0-9]+:[ ]*d5 11 f7 14 24 notl \(%r28\)
+[ ]*[a-f0-9]+:[ ]*d5 18 f7 14 24 notq \(%r20\)
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-apx-rex2.s b/gas/testsuite/gas/i386/x86-64-apx-rex2.s
index eaaaaa7..5102dc3 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-rex2.s
+++ b/gas/testsuite/gas/i386/x86-64-apx-rex2.s
@@ -83,3 +83,9 @@ _start:
leal 1(%r16, %r28), %r31d
leal 129(%r20, %r8), %eax
leal 129(%r28, %r8), %r31d
+
+## explicit REX prefix
+ rex.r notl (%r20)
+ rex.x notl (%r20)
+ rex.b notl (%r20)
+ rex.w not (%r20)