diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-04-10 03:48:29 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-04-10 03:48:29 +0000 |
| commit | 9b6d69e0c214fd0925290b3053f418fa29fbc28c (patch) | |
| tree | 1a0bc759798917521e22b61eb1fb19f6e55ea2fa | |
| parent | f269d84ca0a0b88d0a7836c89fcb3eac44e01584 (diff) | |
| download | bcm5719-llvm-9b6d69e0c214fd0925290b3053f418fa29fbc28c.tar.gz bcm5719-llvm-9b6d69e0c214fd0925290b3053f418fa29fbc28c.zip | |
restore support for negative strides
llvm-svn: 35859
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index a4e6d64b7c7..6cefec9de31 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -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: |

