OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse-2.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O3 -msse" } */
3
/* { dg-require-effective-target sse } */
4
#include <xmmintrin.h>
5
static const __m128 v_sign = {-.0f, -.0f, -.0f, -.0f};
6
static const __m128 v_half = {0.5f, 0.5f, 0.5f, 0.5f};
7
static const __m128 v_one  = {1.0f, 1.0f, 1.0f, 1.0f};
8
static inline __m128 insn_ABS (__m128 a)
9
{
10
  return _mm_andnot_ps (v_sign, a);
11
}
12
__m128 voodoo (__m128 a)
13
{
14
  __m128 x = insn_ABS (a), y = _mm_rsqrt_ps (x);
15
  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);
16
  return y;
17
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.