mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-14 22:38:03 +00:00
restore support for negative strides
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6eb6d7255
commit
eb13d1b710
@ -1372,6 +1372,7 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
||||
return false;
|
||||
|
||||
default:
|
||||
int Scale = AM.Scale;
|
||||
switch (getValueType(Ty)) {
|
||||
default: return false;
|
||||
case MVT::i1:
|
||||
@ -1381,14 +1382,15 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
||||
// 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 == 1)
|
||||
if (Scale < 0) Scale = -Scale;
|
||||
if (Scale == 1)
|
||||
return true;
|
||||
// r + r << imm
|
||||
if (!isPowerOf2_32(AM.Scale & ~1))
|
||||
if (!isPowerOf2_32(Scale & ~1))
|
||||
return false;
|
||||
case MVT::i16:
|
||||
// r + r
|
||||
if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2)
|
||||
if (((unsigned)AM.HasBaseReg + Scale) <= 2)
|
||||
return true;
|
||||
|
||||
case MVT::isVoid:
|
||||
|
Loading…
x
Reference in New Issue
Block a user