summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/sse-builtins.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit056abd2059c65a3e908193aeae16fad98017437c (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CodeGen/sse-builtins.c
parentcc73504950eb7b5dff2dded9bedd67bc36d64641 (diff)
downloadFreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip
FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'test/CodeGen/sse-builtins.c')
-rw-r--r--test/CodeGen/sse-builtins.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/sse-builtins.c b/test/CodeGen/sse-builtins.c
index 0e48560..400209f 100644
--- a/test/CodeGen/sse-builtins.c
+++ b/test/CodeGen/sse-builtins.c
@@ -1,8 +1,39 @@
// RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -target-cpu pentium4 -target-feature +sse4.1 -g -emit-llvm %s -o - | FileCheck %s
+#include <xmmintrin.h>
#include <emmintrin.h>
#include <smmintrin.h>
+__m128 test_rsqrt_ss(__m128 x) {
+ // CHECK: define {{.*}} @test_rsqrt_ss
+ // CHECK: call <4 x float> @llvm.x86.sse.rsqrt.ss
+ // CHECK: extractelement <4 x float> {{.*}}, i32 0
+ // CHECK: extractelement <4 x float> {{.*}}, i32 1
+ // CHECK: extractelement <4 x float> {{.*}}, i32 2
+ // CHECK: extractelement <4 x float> {{.*}}, i32 3
+ return _mm_rsqrt_ss(x);
+}
+
+__m128 test_rcp_ss(__m128 x) {
+ // CHECK: define {{.*}} @test_rcp_ss
+ // CHECK: call <4 x float> @llvm.x86.sse.rcp.ss
+ // CHECK: extractelement <4 x float> {{.*}}, i32 0
+ // CHECK: extractelement <4 x float> {{.*}}, i32 1
+ // CHECK: extractelement <4 x float> {{.*}}, i32 2
+ // CHECK: extractelement <4 x float> {{.*}}, i32 3
+ return _mm_rcp_ss(x);
+}
+
+__m128 test_sqrt_ss(__m128 x) {
+ // CHECK: define {{.*}} @test_sqrt_ss
+ // CHECK: call <4 x float> @llvm.x86.sse.sqrt.ss
+ // CHECK: extractelement <4 x float> {{.*}}, i32 0
+ // CHECK: extractelement <4 x float> {{.*}}, i32 1
+ // CHECK: extractelement <4 x float> {{.*}}, i32 2
+ // CHECK: extractelement <4 x float> {{.*}}, i32 3
+ return _mm_sqrt_ss(x);
+}
+
__m128 test_loadl_pi(__m128 x, void* y) {
// CHECK: define {{.*}} @test_loadl_pi
// CHECK: load <2 x float>* {{.*}}, align 1{{$}}
OpenPOWER on IntegriCloud