URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 384 |
/* PR target/21149 */
|
/* PR target/21149 */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2 -msse" } */
|
/* { dg-options "-O2 -msse" } */
|
/* { dg-require-effective-target sse } */
|
/* { dg-require-effective-target sse } */
|
|
|
#include "sse-check.h"
|
#include "sse-check.h"
|
|
|
#include <xmmintrin.h>
|
#include <xmmintrin.h>
|
|
|
void
|
void
|
__attribute__((noinline))
|
__attribute__((noinline))
|
check (__m128 x, float a, float b, float c, float d)
|
check (__m128 x, float a, float b, float c, float d)
|
{
|
{
|
union { __m128 m; float f[4]; } u;
|
union { __m128 m; float f[4]; } u;
|
u.m = x;
|
u.m = x;
|
if (u.f[0] != a || u.f[1] != b || u.f[2] != c || u.f[3] != d)
|
if (u.f[0] != a || u.f[1] != b || u.f[2] != c || u.f[3] != d)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
static inline
|
static inline
|
void
|
void
|
foo (__m128 *x)
|
foo (__m128 *x)
|
{
|
{
|
__m128 y = _mm_setzero_ps ();
|
__m128 y = _mm_setzero_ps ();
|
__m128 v = _mm_movehl_ps (y, *x);
|
__m128 v = _mm_movehl_ps (y, *x);
|
__m128 w = _mm_movehl_ps (*x, y);
|
__m128 w = _mm_movehl_ps (*x, y);
|
check (*x, 9, 1, 2, -3);
|
check (*x, 9, 1, 2, -3);
|
check (v, 2, -3, 0, 0);
|
check (v, 2, -3, 0, 0);
|
check (w, 0, 0, 2, -3);
|
check (w, 0, 0, 2, -3);
|
}
|
}
|
|
|
static void
|
static void
|
sse_test (void)
|
sse_test (void)
|
{
|
{
|
__m128 y = _mm_set_ps (-3, 2, 1, 9);
|
__m128 y = _mm_set_ps (-3, 2, 1, 9);
|
foo (&y);
|
foo (&y);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.