mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Teach the address selector to make 'reg+reg' addressing modes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -443,9 +443,18 @@ bool ISel::SelectAddress(SDOperand N, X86AddressMode &AM) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AM.BaseType != X86AddressMode::RegBase ||
|
// Is the base register already occupied?
|
||||||
AM.Base.Reg)
|
if (AM.BaseType != X86AddressMode::RegBase || AM.Base.Reg) {
|
||||||
|
// If so, check to see if the scale index register is set.
|
||||||
|
if (AM.IndexReg == 0) {
|
||||||
|
AM.IndexReg = SelectExpr(N);
|
||||||
|
AM.Scale = 1;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, we cannot select it.
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Default, generate it as a register.
|
// Default, generate it as a register.
|
||||||
AM.BaseType = X86AddressMode::RegBase;
|
AM.BaseType = X86AddressMode::RegBase;
|
||||||
|
Reference in New Issue
Block a user