static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
_mm_sqrt_ss(__m128 a)
{
- return __builtin_ia32_sqrtss(a);
+ __m128 c = __builtin_ia32_sqrtss(a);
+ return (__m128) { c[0], a[1], a[2], a[3] };
}
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
_mm_rcp_ss(__m128 a)
{
- return __builtin_ia32_rcpss(a);
+ __m128 c = __builtin_ia32_rcpss(a);
+ return (__m128) { c[0], a[1], a[2], a[3] };
}
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
_mm_rsqrt_ss(__m128 a)
{
- return __builtin_ia32_rsqrtss(a);
+ __m128 c = __builtin_ia32_rsqrtss(a);
+ return (__m128) { c[0], a[1], a[2], a[3] };
}
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
// 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{{$}}