diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-08-19 02:23:56 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2011-08-19 02:23:56 +0000 |
| commit | 22241acc29b827cf0dcdaa4a7f21fb7992584fbc (patch) | |
| tree | 577b5c410988b054c2ae1cff34cf6ff05658cc03 /llvm/lib | |
| parent | 6949077f744775c7a3ebc75039f412eb7f1bbcb9 (diff) | |
| download | bcm5719-llvm-22241acc29b827cf0dcdaa4a7f21fb7992584fbc.tar.gz bcm5719-llvm-22241acc29b827cf0dcdaa4a7f21fb7992584fbc.zip | |
Fix PR10677. Initial patch and idea by Peter Cooper but I've changed the
implementation!
llvm-svn: 138029
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp index cf582b58446..6c7b386f2d1 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp @@ -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; |

