aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-12-29 16:10:46 +0000
committerCraig Topper <craig.topper@gmail.com>2011-12-29 16:10:46 +0000
commite14e08b2552b43d81a295401ddf9b8da2c499233 (patch)
treea6098ab9acaa1e14ae5a8d5b6d088bfa7c922c05 /test
parent63d32bdf895e1ad8cfeef8e634a84fe136215202 (diff)
Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/popcnt-builtins.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/popcnt-builtins.c b/test/CodeGen/popcnt-builtins.c
new file mode 100644
index 0000000000..f072b29cd1
--- /dev/null
+++ b/test/CodeGen/popcnt-builtins.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +popcnt -emit-llvm -o - | FileCheck %s
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <x86intrin.h>
+
+unsigned int test_mm_popcnt_u32(unsigned int __X) {
+ // CHECK: @llvm.ctpop.i32
+ return _mm_popcnt_u32(__X);
+}
+
+unsigned long long test_mm_popcnt_u64(unsigned long long __X) {
+ // CHECK: @llvm.ctpop.i64
+ return _mm_popcnt_u64(__X);
+}