mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 20:04:03 +00:00
Add i16 address mode.
llvm-svn: 35551
This commit is contained in:
parent
f9dad9ed2f
commit
949a34fbad
@ -1300,19 +1300,24 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
||||
return false;
|
||||
|
||||
default:
|
||||
// FIXME: verify.
|
||||
switch (getValueType(Ty)) {
|
||||
default: return false;
|
||||
case MVT::i1:
|
||||
case MVT::i8:
|
||||
// TODO: i16? i64 should be i32, no?
|
||||
case MVT::i32:
|
||||
case MVT::i64:
|
||||
// This assumes i64 is legalized to a pair of i32. If not (i.e.
|
||||
// ldrd / strd are used, then its address mode is same as i16.
|
||||
// r + r
|
||||
if (AM.Scale == 2)
|
||||
return true;
|
||||
// r + r << imm
|
||||
if (!isPowerOf2_32(AM.Scale & ~1))
|
||||
return false;
|
||||
case MVT::i16:
|
||||
// r + r
|
||||
if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user