URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-require-effective-target avx } */
|
/* { dg-require-effective-target avx } */
|
/* { dg-options "-O2 -mavx" } */
|
/* { dg-options "-O2 -mavx" } */
|
|
|
#include "avx-check.h"
|
#include "avx-check.h"
|
|
|
#ifndef OFFSET
|
#ifndef OFFSET
|
#define OFFSET 1
|
#define OFFSET 1
|
#endif
|
#endif
|
|
|
#if OFFSET < 0 || OFFSET > 1
|
#if OFFSET < 0 || OFFSET > 1
|
#error OFFSET must be within [0..1]
|
#error OFFSET must be within [0..1]
|
#endif
|
#endif
|
|
|
void static
|
void static
|
avx_test (void)
|
avx_test (void)
|
{
|
{
|
int i;
|
int i;
|
union256d u, s1;
|
union256d u, s1;
|
union128d s2;
|
union128d s2;
|
double e [4];
|
double e [4];
|
|
|
s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356);
|
s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356);
|
s2.x = _mm_set_pd (68543.731254, 3452.578238);
|
s2.x = _mm_set_pd (68543.731254, 3452.578238);
|
u.x = _mm256_insertf128_pd (s1.x, s2.x, OFFSET);
|
u.x = _mm256_insertf128_pd (s1.x, s2.x, OFFSET);
|
|
|
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
e[i] = s1.a[i];
|
e[i] = s1.a[i];
|
|
|
for (i=0; i < 2; i++)
|
for (i=0; i < 2; i++)
|
e[i + (OFFSET * 2)] = s2.a[i];
|
e[i + (OFFSET * 2)] = s2.a[i];
|
|
|
if (check_union256d (u, e))
|
if (check_union256d (u, e))
|
abort ();
|
abort ();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.