diff options
author | Cui, Lili <lili.cui@intel.com> | 2024-04-22 09:25:56 +0800 |
---|---|---|
committer | Cui, Lili <lili.cui@intel.com> | 2024-04-22 09:25:56 +0800 |
commit | b5247082c4a71f69ba53e5b076409f25918d953f (patch) | |
tree | 76dca7f272f991bdb0cdff387b6773b3128a73f2 /gas | |
parent | 80fa407f9fb8df8b4d4ac3d5db8cc7bdc07eab7f (diff) | |
download | binutils-b5247082c4a71f69ba53e5b076409f25918d953f.zip binutils-b5247082c4a71f69ba53e5b076409f25918d953f.tar.gz binutils-b5247082c4a71f69ba53e5b076409f25918d953f.tar.bz2 |
x86/APX: Add invalid check for APX EVEX.X4.
gas/ChangeLog:
* config/tc-i386.c (build_apx_evex_prefix): Added invalid check for APX
X4.
* testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Added invalid
testcase.
* testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.
opcodes/ChangeLog:
* i386-dis.c (get_valid_dis386): Added invalid check for APX X4.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-i386.c | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 1637f55..b037468 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4276,7 +4276,10 @@ build_apx_evex_prefix (void) if (i.rex2 & REX_B) i.vex.bytes[1] |= 0x08; if (i.rex2 & REX_X) - i.vex.bytes[2] &= ~0x04; + { + gas_assert (i.rm.mode != 3); + i.vex.bytes[2] &= ~0x04; + } if (i.vex.register_specifier && i.vex.register_specifier->reg_flags & RegRex2) i.vex.bytes[3] &= ~0x08; diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d index 1a6b665..6330367 100644 --- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d +++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d @@ -39,4 +39,6 @@ Disassembly of section .text: [ ]*[a-f0-9]+:[ ]+62 d4 24 18 8f[ ]+\(bad\) [ ]*[a-f0-9]+:[ ]+c3[ ]+.* [ ]*[a-f0-9]+:[ ]+62 fc 7d 0c 60 c7[ ]+movbe \{bad-nf\},%r23w,%ax +[ ]*[a-f0-9]+:[ ]+62 fc 79 08 60[ ]+\(bad\) +[ ]*[a-f0-9]+:[ ]+c2[ ]+.* #pass diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s index bc55b5e..cbf3451 100644 --- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s +++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s @@ -53,3 +53,6 @@ _start: #EVEX_MAP4 movbe %r18w,%ax set EVEX.nf = 1. .insn EVEX.L0.66.M12.W0 0x60, %di, %ax {%k4} + + # EVEX_MAP4 movbe %r18w,%ax set EVEX.P[10] = 0. + .byte 0x62, 0xfc, 0x79, 0x08, 0x60, 0xc2 |