Patch attached to rename hints intrinsic back to their conventional naming.

Cheers,
Yi

On 23 June 2014 23:00, Yi Kong <[email protected]> wrote:
> On 23 June 2014 18:09, Saleem Abdulrasool <[email protected]> wrote:
>>
>> On Jun 23, 2014, at 9:33 AM, Yi Kong <[email protected]> wrote:
>>
>>> Saleem Abdulrasool <compnerd@...> writes:
>>>
>>>>
>>>> Author: compnerd
>>>> Date: Fri May  2 01:53:57 2014
>>>> New Revision: 207829
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=207829&view=rev
>>>> Log:
>>>> CodeGen: rename __builtin_arm_sevl to __sevl
>>>>
>>>> ACLE adds the __sevl() extension.  Rename the hint from a custom name to
>>> the
>>>> ACLE specified name.
>>>>
>>>
>>> The renaming breaks the naming convention for Clang built-in intrinsics.
>>> Every target-specific intrinsic should begin with __builtin_ArchName.
>>>
>>> __sevl should be defined to __builtin_arm_sevl in arm_acle.h file.
>>
>> Sorry, I guess that I should have added more context into the commit 
>> message.  This was discussed on IRC between Tim, Joey, Renato, and I.  The 
>> ACLE defines the spelling to be __sevl, and since the change wasn’t there 
>> for very long, we decided that we would use the proper spelling.  __sevl is 
>> already in a reserved namespace for the system, and providing an official 
>> extension symbol in that namespace is fine.
>
> ACLE defines the spelling in the arm_acle.h header file instead of the
> compiler intrinsics.
>
> Since I'm currently working on the ACLE header file, I think it would
> be best to stick to the conventional naming and map __sevl to
> __builtin_arm_sevl in arm_acle.h.
>
> -Yi
>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> [email protected]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>> --
>> Saleem Abdulrasool
>> abdulras (at) fb (dot) com
>>
From dd595ecc51a4621d6c448fc51764f46ff5d21e2f Mon Sep 17 00:00:00 2001
From: Yi Kong <[email protected]>
Date: Fri, 27 Jun 2014 15:22:06 +0100
Subject: [PATCH] Rename ARM hints intrinsics name back

This reverts the renaming in r207829.
---
 include/clang/Basic/BuiltinsARM.def   | 10 +++++-----
 lib/CodeGen/CGBuiltin.cpp             | 10 +++++-----
 test/CodeGen/builtins-arm-microsoft.c |  2 +-
 test/CodeGen/builtins-arm.c           | 10 +++++-----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def
index 5ba8d8e..a108568 100644
--- a/include/clang/Basic/BuiltinsARM.def
+++ b/include/clang/Basic/BuiltinsARM.def
@@ -62,11 +62,11 @@ BUILTIN(__builtin_arm_crc32d, "UiUiLLUi", "nc")
 BUILTIN(__builtin_arm_crc32cd, "UiUiLLUi", "nc")
 
 // HINT
-BUILTIN(__yield, "v", "")
-BUILTIN(__wfe, "v", "")
-BUILTIN(__wfi, "v", "")
-BUILTIN(__sev, "v", "")
-BUILTIN(__sevl, "v", "")
+BUILTIN(__builtin_arm_yield, "v", "")
+BUILTIN(__builtin_arm_wfe, "v", "")
+BUILTIN(__builtin_arm_wfi, "v", "")
+BUILTIN(__builtin_arm_sev, "v", "")
+BUILTIN(__builtin_arm_sevl, "v", "")
 
 // Data barrier
 BUILTIN(__builtin_arm_dmb, "vUi", "nc")
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index d9d1fd1..94c93b0 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -3061,19 +3061,19 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
   unsigned HintID = static_cast<unsigned>(-1);
   switch (BuiltinID) {
   default: break;
-  case ARM::BI__yield:
+  case ARM::BI__builtin_arm_yield:
     HintID = 1;
     break;
-  case ARM::BI__wfe:
+  case ARM::BI__builtin_arm_wfe:
     HintID = 2;
     break;
-  case ARM::BI__wfi:
+  case ARM::BI__builtin_arm_wfi:
     HintID = 3;
     break;
-  case ARM::BI__sev:
+  case ARM::BI__builtin_arm_sev:
     HintID = 4;
     break;
-  case ARM::BI__sevl:
+  case ARM::BI__builtin_arm_sevl:
     HintID = 5;
     break;
   }
diff --git a/test/CodeGen/builtins-arm-microsoft.c b/test/CodeGen/builtins-arm-microsoft.c
index 682ec91..62b224c 100644
--- a/test/CodeGen/builtins-arm-microsoft.c
+++ b/test/CodeGen/builtins-arm-microsoft.c
@@ -3,7 +3,7 @@
 // REQUIRES: arm-registered-target
 
 void test_yield_intrinsic() {
-  __yield();
+  __builtin_arm_yield();
 }
 
 // CHECK: call void @llvm.arm.hint(i32 1)
diff --git a/test/CodeGen/builtins-arm.c b/test/CodeGen/builtins-arm.c
index 450ac4b..9532dd7 100644
--- a/test/CodeGen/builtins-arm.c
+++ b/test/CodeGen/builtins-arm.c
@@ -20,31 +20,31 @@ void test_eh_return_data_regno()
 }
 
 void yield() {
-  __yield();
+  __builtin_arm_yield();
 }
 
 // CHECK: call {{.*}} @llvm.arm.hint(i32 1)
 
 void wfe() {
-  __wfe();
+  __builtin_arm_wfe();
 }
 
 // CHECK: call {{.*}} @llvm.arm.hint(i32 2)
 
 void wfi() {
-  __wfi();
+  __builtin_arm_wfi();
 }
 
 // CHECK: call {{.*}} @llvm.arm.hint(i32 3)
 
 void sev() {
-  __sev();
+  __builtin_arm_sev();
 }
 
 // CHECK: call {{.*}} @llvm.arm.hint(i32 4)
 
 void sevl() {
-  __sevl();
+  __builtin_arm_sevl();
 }
 // CHECK: call {{.*}} @llvm.arm.hint(i32 5)
 
-- 
2.0.1

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to