r196724 - ARM: teach Sema that "r" can match 64-bit values

Tim Northover tnorthover at apple.com
Sun Dec 8 07:24:55 PST 2013


Author: tnorthover
Date: Sun Dec  8 09:24:55 2013
New Revision: 196724

URL: http://llvm.org/viewvc/llvm-project?rev=196724&view=rev
Log:
ARM: teach Sema that "r" can match 64-bit values

We already support using "r" on 64-bit values (a GPRPair is
allocated), but Sema doesn't know this yet so issues a warning. This
should fix it.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/Sema/arm-asm.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=196724&r1=196723&r2=196724&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sun Dec  8 09:24:55 2013
@@ -4110,7 +4110,7 @@ public:
     case 'r': {
       switch (Modifier) {
       default:
-        return (isInOut || isOutput || Size <= 32);
+        return (isInOut || isOutput || Size <= 64);
       case 'q':
         // A register of size 32 cannot fit a vector type.
         return false;

Modified: cfe/trunk/test/Sema/arm-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/arm-asm.c?rev=196724&r1=196723&r2=196724&view=diff
==============================================================================
--- cfe/trunk/test/Sema/arm-asm.c (original)
+++ cfe/trunk/test/Sema/arm-asm.c Sun Dec  8 09:24:55 2013
@@ -5,3 +5,8 @@ void f (void) {
   asm volatile ("lw (r1), %0[val]": "=&b"(Val)); // expected-error {{invalid output constraint '=&b' in asm}}
   return;
 }
+
+void test_64bit_r(void) {
+  long long foo = 0, bar = 0;
+  asm volatile("INST %0, %1" : "=r"(foo) : "r"(bar));
+}





More information about the cfe-commits mailing list