[llvm] r333714 - [X86][Disassembler] Suppress reading of EVEX.V' and EVEX.R' in 32-bit mode.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu May 31 17:10:36 PDT 2018
Author: ctopper
Date: Thu May 31 17:10:36 2018
New Revision: 333714
URL: http://llvm.org/viewvc/llvm-project?rev=333714&view=rev
Log:
[X86][Disassembler] Suppress reading of EVEX.V' and EVEX.R' in 32-bit mode.
Modified:
llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
llvm/trunk/test/MC/Disassembler/X86/x86-32.txt
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp?rev=333714&r1=333713&r2=333714&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp Thu May 31 17:10:36 2018
@@ -1341,7 +1341,7 @@ static int readModRM(struct InternalInst
reg |= rFromREX(insn->rexPrefix) << 3;
rm |= bFromREX(insn->rexPrefix) << 3;
- if (insn->vectorExtensionType == TYPE_EVEX) {
+ if (insn->vectorExtensionType == TYPE_EVEX && insn->mode == MODE_64BIT) {
reg |= r2FromEVEX2of4(insn->vectorExtensionPrefix[1]) << 4;
rm |= xFromEVEX2of4(insn->vectorExtensionPrefix[1]) << 4;
}
@@ -1759,7 +1759,7 @@ static int readOperands(struct InternalI
insn->sibIndex = (SIBIndex)4;
// If EVEX.v2 is set this is one of the 16-31 registers.
- if (insn->vectorExtensionType == TYPE_EVEX &&
+ if (insn->vectorExtensionType == TYPE_EVEX && insn->mode == MODE_64BIT &&
v2FromEVEX4of4(insn->vectorExtensionPrefix[3]))
insn->sibIndex = (SIBIndex)(insn->sibIndex + 16);
Modified: llvm/trunk/test/MC/Disassembler/X86/x86-32.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/X86/x86-32.txt?rev=333714&r1=333713&r2=333714&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/X86/x86-32.txt (original)
+++ llvm/trunk/test/MC/Disassembler/X86/x86-32.txt Thu May 31 17:10:36 2018
@@ -884,8 +884,8 @@
#CHECK: enclv
0x0f 0x01 0xc0
-#CHECK: vaddps %xmm2, %xmm1, %xmm16
+#CHECK: vaddps %xmm2, %xmm1, %xmm0
0x62 0xe1 0x74 0x00 0x58 0xc2
-#CHECK: vgatherdps (%esi,%zmm16,4), %zmm1 {%k2}
+#CHECK: vgatherdps (%esi,%zmm0,4), %zmm1 {%k2}
0x62 0xf2 0x7d 0x42 0x92 0x0c 0x86
More information about the llvm-commits
mailing list