mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +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:
parent
99f997d2c1
commit
a95589be3f
@ -443,9 +443,18 @@ bool ISel::SelectAddress(SDOperand N, X86AddressMode &AM) {
|
||||
}
|
||||
}
|
||||
|
||||
if (AM.BaseType != X86AddressMode::RegBase ||
|
||||
AM.Base.Reg)
|
||||
// Is the base register already occupied?
|
||||
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;
|
||||
}
|
||||
|
||||
// Default, generate it as a register.
|
||||
AM.BaseType = X86AddressMode::RegBase;
|
||||
|
Loading…
Reference in New Issue
Block a user