summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtin-cpu-supports.c
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-10-20 03:51:52 +0000
committerCraig Topper <craig.topper@intel.com>2018-10-20 03:51:52 +0000
commit4d8ced1807a044a349825ead80b7a15f1872e000 (patch)
tree15b7c8f8aed9d1a2f016b71d061efd8b5fd23dac /clang/test/CodeGen/builtin-cpu-supports.c
parent0aca35df77e3be49160b20c54f894e71e6cc8f2e (diff)
downloadbcm5719-llvm-4d8ced1807a044a349825ead80b7a15f1872e000.tar.gz
bcm5719-llvm-4d8ced1807a044a349825ead80b7a15f1872e000.zip
[X86] Add support for more than 32 features for __builtin_cpu_is
libgcc supports more than 32 features by adding a new 32-bit variable __cpu_features2. This adds the clang support for checking these feature bits. Patches for compiler-rt and llvm to support this are coming as well. Probably still need an additional patch for target multiversioning in clang. Differential Revision: https://reviews.llvm.org/D53458 llvm-svn: 344832
Diffstat (limited to 'clang/test/CodeGen/builtin-cpu-supports.c')
-rw-r--r--clang/test/CodeGen/builtin-cpu-supports.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtin-cpu-supports.c b/clang/test/CodeGen/builtin-cpu-supports.c
index 4964b98e6f5..d384efbc208 100644
--- a/clang/test/CodeGen/builtin-cpu-supports.c
+++ b/clang/test/CodeGen/builtin-cpu-supports.c
@@ -16,5 +16,12 @@ int main() {
// CHECK: [[AND:%[^ ]+]] = and i32 [[LOAD]], 256
// CHECK: = icmp eq i32 [[AND]], 256
+ if (__builtin_cpu_supports("gfni"))
+ a("gfni");
+
+ // CHECK: [[LOAD:%[^ ]+]] = load i32, i32* @__cpu_features2
+ // CHECK: [[AND:%[^ ]+]] = and i32 [[LOAD]], 1
+ // CHECK: = icmp eq i32 [[AND]], 1
+
return 0;
}
OpenPOWER on IntegriCloud