Changed getSOImmValRotate()'s hunt retry logic to ignore the low order 6 bits,
authorJohnny Chen <johnny.chen@apple.com>
Tue, 13 Apr 2010 20:35:16 +0000 (20:35 +0000)
committerJohnny Chen <johnny.chen@apple.com>
Tue, 13 Apr 2010 20:35:16 +0000 (20:35 +0000)
instead of 7, because we are only looking for even rotate amount.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAddressingModes.h

index f414744fa2f3689f049bed62b6f79ab003c7c45d..e68354a42f8da46b19f5a18c0ef15242666b99ac 100644 (file)
@@ -151,10 +151,10 @@ namespace ARM_AM {
     if ((rotr32(Imm, RotAmt) & ~255U) == 0)
       return (32-RotAmt)&31;  // HW rotates right, not left.
 
-    // For values like 0xF000000F, we should ignore the low 7 bits, then
+    // For values like 0xF000000F, we should ignore the low 6 bits, then
     // retry the hunt.
-    if (Imm & 127U) {
-      unsigned TZ2 = CountTrailingZeros_32(Imm & ~127U);
+    if (Imm & 63U) {
+      unsigned TZ2 = CountTrailingZeros_32(Imm & ~63U);
       unsigned RotAmt2 = TZ2 & ~1;
       if ((rotr32(Imm, RotAmt2) & ~255U) == 0)
         return (32-RotAmt2)&31;  // HW rotates right, not left.