Fix PR10677. Initial patch and idea by Peter Cooper but I've changed the

implementation!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bruno Cardoso Lopes 2011-08-19 02:23:56 +00:00
parent 61b2d7f207
commit 863e0f25b7
2 changed files with 24 additions and 3 deletions

View File

@ -533,9 +533,14 @@ void X86MCCodeEmitter::EmitVEXOpcodePrefix(uint64_t TSFlags, unsigned &CurByte,
const MCOperand &MO = MI.getOperand(CurOp);
if (MO.isReg() && X86II::isX86_64ExtendedReg(MO.getReg()))
VEX_B = 0x0;
if (!VEX_B && MO.isReg() &&
((TSFlags & X86II::FormMask) == X86II::MRMSrcMem) &&
X86II::isX86_64ExtendedReg(MO.getReg()))
// Only set VEX_X if the Index Register is extended
if (VEX_B || !MO.isReg())
continue;
if (!X86II::isX86_64ExtendedReg(MO.getReg()))
continue;
unsigned Frm = TSFlags & X86II::FormMask;
if ((Frm == X86II::MRMSrcMem && CurOp-1 == X86::AddrIndexReg) ||
(Frm == X86II::MRMDestMem && CurOp == X86::AddrIndexReg))
VEX_X = 0x0;
}
break;

View File

@ -3316,3 +3316,19 @@ vdivpd -4(%rcx,%rbx,8), %xmm10, %xmm11
// CHECK: encoding: [0xc4,0x63,0x1d,0x4b,0xac,0x20,0xad,0xde,0x00,0x00,0xb0]
vblendvpd %ymm11, 0xdead(%rax,%riz), %ymm12, %ymm13
// CHECK: vmovaps %xmm3, (%r14,%r11)
// CHECK: encoding: [0xc4,0x81,0x78,0x29,0x1c,0x1e]
vmovaps %xmm3, (%r14,%r11)
// CHECK: vmovaps (%r14,%r11), %xmm3
// CHECK: encoding: [0xc4,0x81,0x78,0x28,0x1c,0x1e]
vmovaps (%r14,%r11), %xmm3
// CHECK: vmovaps %xmm3, (%r14,%rbx)
// CHECK: encoding: [0xc4,0xc1,0x78,0x29,0x1c,0x1e]
vmovaps %xmm3, (%r14,%rbx)
// CHECK: vmovaps (%r14,%rbx), %xmm3
// CHECK: encoding: [0xc4,0xc1,0x78,0x28,0x1c,0x1e]
vmovaps (%r14,%rbx), %xmm3