r266212 - AArch64: allow 64-bit access to sysregs.
Tim Northover via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 13 10:08:55 PDT 2016
Author: tnorthover
Date: Wed Apr 13 12:08:55 2016
New Revision: 266212
URL: http://llvm.org/viewvc/llvm-project?rev=266212&view=rev
Log:
AArch64: allow 64-bit access to sysregs.
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.
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/test/Sema/aarch64-special-register.c
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=266212&r1=266211&r2=266212&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Apr 13 12:08:55 2016
@@ -1155,7 +1155,7 @@ bool Sema::CheckAArch64BuiltinFunctionCa
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 ||
Modified: cfe/trunk/test/Sema/aarch64-special-register.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/aarch64-special-register.c?rev=266212&r1=266211&r2=266212&view=diff
==============================================================================
--- cfe/trunk/test/Sema/aarch64-special-register.c (original)
+++ cfe/trunk/test/Sema/aarch64-special-register.c Wed Apr 13 12:08:55 2016
@@ -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) {
More information about the cfe-commits
mailing list