summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Thumb2SizeReduction.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-01 19:07:09 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-01 19:07:09 +0000
commiteb03c3b22861e5fb6459aa055378e852df29b621 (patch)
tree735085d6579f31f4a940b6aecab72b67c86ee5f6 /lib/Target/ARM/Thumb2SizeReduction.cpp
parent4db3cffe94a5285239cc0056f939c6b74a5ca0b6 (diff)
downloadllvm-eb03c3b22861e5fb6459aa055378e852df29b621.tar.gz
llvm-eb03c3b22861e5fb6459aa055378e852df29b621.tar.bz2
llvm-eb03c3b22861e5fb6459aa055378e852df29b621.tar.xz
Fix off-by-one error.
(low two bits always zero, so off by one bit of encoded value). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Thumb2SizeReduction.cpp')
-rw-r--r--lib/Target/ARM/Thumb2SizeReduction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/ARM/Thumb2SizeReduction.cpp b/lib/Target/ARM/Thumb2SizeReduction.cpp
index 692189ce6c..c741a6e8a5 100644
--- a/lib/Target/ARM/Thumb2SizeReduction.cpp
+++ b/lib/Target/ARM/Thumb2SizeReduction.cpp
@@ -491,7 +491,7 @@ Thumb2SizeReduce::ReduceSpecial(MachineBasicBlock &MBB, MachineInstr *MI,
// The immediate must be in range, the destination register must be a low
// reg, the predicate must be "always" and the condition flags must not
// be being set.
- if (Imm & 3 || Imm > 1024)
+ if (Imm & 3 || Imm > 1020)
return false;
if (!isARMLowRegister(MI->getOperand(0).getReg()))
return false;