mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Initial implementation of MipsTargetLowering::isLegalAddressingMode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168230 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3482,6 +3482,26 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
TargetLowering::LowerAsmOperandForConstraint(Op, Constraint, Ops, DAG);
|
||||
}
|
||||
|
||||
bool
|
||||
MipsTargetLowering::isLegalAddressingMode(const AddrMode &AM, Type *Ty) const {
|
||||
// No global is ever allowed as a base.
|
||||
if (AM.BaseGV)
|
||||
return false;
|
||||
|
||||
switch (AM.Scale) {
|
||||
case 0: // "r+i" or just "i", depending on HasBaseReg.
|
||||
break;
|
||||
case 1:
|
||||
if (!AM.HasBaseReg) // allow "r+i".
|
||||
break;
|
||||
return false; // disallow "r+r" or "r+r+i".
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
MipsTargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const {
|
||||
// The Mips target isn't yet aware of offsets.
|
||||
|
Reference in New Issue
Block a user