]> granicus.if.org Git - clang/commitdiff
AArch64: allow 64-bit access to sysregs.
authorTim Northover <tnorthover@apple.com>
Wed, 13 Apr 2016 17:08:55 +0000 (17:08 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 13 Apr 2016 17:08:55 +0000 (17:08 +0000)
Although all the registers are actually 32-bits, I think we have to assume the
high 32-bits could be RES0 (the ARM ARM is unclear). If so, reading as a 32-bit
register can require extra zero extension operations.

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

lib/Sema/SemaChecking.cpp
test/Sema/aarch64-special-register.c

index ee39401d48a94a83141f72abe48f9c385c0eb85d..6047030129a5b8eb7166261176326c5715dccd51 100644 (file)
@@ -1155,7 +1155,7 @@ bool Sema::CheckAArch64BuiltinFunctionCall(unsigned BuiltinID,
 
   if (BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
       BuiltinID == AArch64::BI__builtin_arm_wsr64)
-    return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 5, false);
+    return SemaBuiltinARMSpecialReg(BuiltinID, TheCall, 0, 5, true);
 
   if (BuiltinID == AArch64::BI__builtin_arm_rsr ||
       BuiltinID == AArch64::BI__builtin_arm_rsrp ||
index 40d4033967f87bb4feef8672fc4eea3bdb4ca81a..a4fb92b5235b3e3e85c08acde4795c994df131ad 100644 (file)
@@ -13,7 +13,7 @@ void wsrp_1(void *v) {
 }
 
 void wsr64_1(unsigned long v) {
-  __builtin_arm_wsr64("sysreg", v); //expected-error {{invalid special register for builtin}}
+  __builtin_arm_wsr64("sysreg", v);
 }
 
 unsigned rsr_1() {
@@ -25,7 +25,7 @@ void *rsrp_1() {
 }
 
 unsigned long rsr64_1() {
-  return __builtin_arm_rsr64("sysreg"); //expected-error {{invalid special register for builtin}}
+  return __builtin_arm_rsr64("sysreg");
 }
 
 void wsr_2(unsigned v) {