mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
Teach the address selector to make 'reg+reg' addressing modes.
llvm-svn: 19457
This commit is contained in:
parent
7e9642515c
commit
f867443d7e
@ -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