mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Two changes relevant to LEA and x32:
1) allows the use of RIP-relative addressing in 32-bit LEA instructions under x86-64 (ILP32 and LP64) 2) separates the size of address registers in 64-bit LEA instructions from control by ILP32/LP64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -239,7 +239,8 @@ static void lower_lea64_32mem(MCInst *MI, unsigned OpNo) {
|
||||
if (!MI->getOperand(OpNo+i).isReg()) continue;
|
||||
|
||||
unsigned Reg = MI->getOperand(OpNo+i).getReg();
|
||||
if (Reg == 0) continue;
|
||||
// LEAs can use RIP-relative addressing, and RIP has no sub/super register.
|
||||
if (Reg == 0 || Reg == X86::RIP) continue;
|
||||
|
||||
MI->getOperand(OpNo+i).setReg(getX86SubSuperRegister(Reg, MVT::i64));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user