r191872 - Change __builtin_ia32_bextri_u64 to take an i64imm to match up with LLVM backend changes.
Craig Topper
craig.topper at gmail.com
Wed Oct 2 21:21:20 PDT 2013
Author: ctopper
Date: Wed Oct 2 23:21:19 2013
New Revision: 191872
URL: http://llvm.org/viewvc/llvm-project?rev=191872&view=rev
Log:
Change __builtin_ia32_bextri_u64 to take an i64imm to match up with LLVM backend changes.
An explicit cast is still needed in tbmintrin.h to convert any big integer down to i32imm.
Patch from Yunzhong Gao.
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/tbmintrin.h
cfe/trunk/test/CodeGen/tbm-builtins.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=191872&r1=191871&r2=191872&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Wed Oct 2 23:21:19 2013
@@ -644,7 +644,7 @@ BUILTIN(__builtin_ia32_pext_di, "ULLiULL
// TBM
BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "")
-BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIUi", "")
+BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "")
BUILTIN(__builtin_ia32_blcfill_u32, "UiUi", "")
BUILTIN(__builtin_ia32_blcfill_u64, "ULLiULLi", "")
BUILTIN(__builtin_ia32_blci_u32, "UiUi", "")
Modified: cfe/trunk/lib/Headers/tbmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/tbmintrin.h?rev=191872&r1=191871&r2=191872&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/tbmintrin.h (original)
+++ cfe/trunk/lib/Headers/tbmintrin.h Wed Oct 2 23:21:19 2013
@@ -35,7 +35,7 @@
#define __bextri_u32(a, b) (__builtin_ia32_bextri_u32((a), (b)))
#ifdef __x86_64__
-#define __bextri_u64(a, b) (__builtin_ia32_bextri_u64((a), (b)))
+#define __bextri_u64(a, b) (__builtin_ia32_bextri_u64((a), (int)(b)))
#endif
static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
Modified: cfe/trunk/test/CodeGen/tbm-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/tbm-builtins.c?rev=191872&r1=191871&r2=191872&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/tbm-builtins.c (original)
+++ cfe/trunk/test/CodeGen/tbm-builtins.c Wed Oct 2 23:21:19 2013
@@ -15,6 +15,11 @@ unsigned long long test__bextri_u64(unsi
return __bextri_u64(a, 2);
}
+unsigned long long test__bextri_u64_bigint(unsigned long long a) {
+ // CHECK: call i64 @llvm.x86.tbm.bextri.u64
+ return __bextri_u64(a, 0x7fffffffffLL);
+}
+
unsigned int test__blcfill_u32(unsigned int a) {
// CHECK: call i32 @llvm.x86.tbm.blcfill.u32
return __blcfill_u32(a);
More information about the cfe-commits
mailing list