[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp

Evan Cheng evan.cheng at apple.com
Sun Apr 1 01:07:03 PDT 2007



Changes in directory llvm/lib/Target/ARM:

ARMISelLowering.cpp updated: 1.33 -> 1.34
---
Log message:

Add i16 address mode.

---
Diffs of the changes:  (+7 -2)

 ARMISelLowering.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.33 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.34
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.33	Fri Mar 30 18:15:24 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp	Sun Apr  1 03:06:46 2007
@@ -1300,19 +1300,24 @@
       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;
   }






More information about the llvm-commits mailing list