OSDN Git Service

* gcc.target/i386/sse-13.c: Include <mm_malloc.h>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / sse-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -msse" } */
3 #include <xmmintrin.h>
4 static const __m128 v_sign = {-.0f, -.0f, -.0f, -.0f};
5 static const __m128 v_half = {0.5f, 0.5f, 0.5f, 0.5f};
6 static const __m128 v_one  = {1.0f, 1.0f, 1.0f, 1.0f};
7 static inline __m128 insn_ABS (__m128 a)
8 {
9   return _mm_andnot_ps (v_sign, a);
10 }
11 __m128 voodoo (__m128 a)
12 {
13   __m128 x = insn_ABS (a), y = _mm_rsqrt_ps (x);
14   y = _mm_add_ps (_mm_mul_ps (_mm_sub_ps (_mm_setzero_ps(), _mm_sub_ps (_mm_mul_ps (x, _mm_add_ps (_mm_mul_ps (y, y), _mm_setzero_ps())), v_one)), _mm_add_ps (_mm_mul_ps (y, v_half), _mm_setzero_ps())), y);
15   return y;
16 }