[llvm-commits] [llvm] r66365 - in /llvm/trunk: lib/Target/ARM/ARMSubtarget.cpp test/CodeGen/ARM/uxtb.ll

Evan Cheng evan.cheng at apple.com
Sat Mar 7 20:02:50 PST 2009


Author: evancheng
Date: Sat Mar  7 22:02:49 2009
New Revision: 66365

URL: http://llvm.org/viewvc/llvm-project?rev=66365&view=rev
Log:
Recognize triplets starting with armv5-, armv6- etc. And set the ARM arch version accordingly.

Modified:
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
    llvm/trunk/test/CodeGen/ARM/uxtb.ll

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=66365&r1=66364&r2=66365&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Sat Mar  7 22:02:49 2009
@@ -35,7 +35,23 @@
   // Set the boolean corresponding to the current target triple, or the default
   // if one cannot be determined, to true.
   const std::string& TT = M.getTargetTriple();
-  if (TT.length() > 5) {
+  unsigned Len = TT.length();
+  if (Len >= 5) {
+    if (TT.substr(0, 4) == "armv") {
+      unsigned SubVer = TT[4];
+      if (SubVer > '4' && SubVer <= '9') {
+        if (SubVer >= '6')
+          ARMArchVersion = V6;
+        else if (SubVer == '5') {
+          ARMArchVersion = V5T;
+          if (Len >= 7 && TT[5] == 't' && TT[6] == 'e')
+            ARMArchVersion = V5TE;
+        }
+      }
+    }
+  }
+
+  if (Len > 5) {
     if (TT.find("-darwin") != std::string::npos)
       TargetType = isDarwin;
   } else if (TT.empty()) {

Modified: llvm/trunk/test/CodeGen/ARM/uxtb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/uxtb.ll?rev=66365&r1=66364&r2=66365&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/ARM/uxtb.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/uxtb.ll Sat Mar  7 22:02:49 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
+; RUN: llvm-as < %s | llc -mtriple=armv6-apple-darwin | \
 ; RUN:   grep uxt | count 10
 
 define i32 @test1(i32 %x) {





More information about the llvm-commits mailing list