| 1 |
/* { dg-do run { target { ! ia32 } } } */ |
| 2 |
/* { dg-options "-mavx512f -O2" } */ |
| 3 |
/* { dg-require-effective-target avx512f } */ |
| 4 |
|
| 5 |
#include "avx512f-check.h" |
| 6 |
|
| 7 |
static void |
| 8 |
__attribute__ ((noinline, unused)) |
| 9 |
compute_vcvtusi2ss (float *s1, unsigned long long s2, float *r) |
| 10 |
{ |
| 11 |
r[0] = (float) s2; |
| 12 |
r[1] = s1[1]; |
| 13 |
r[2] = s1[2]; |
| 14 |
r[3] = s1[3]; |
| 15 |
} |
| 16 |
|
| 17 |
static void |
| 18 |
avx512f_test (void) |
| 19 |
{ |
| 20 |
union128 s1, res; |
| 21 |
unsigned long long s2; |
| 22 |
float res_ref[4]; |
| 23 |
|
| 24 |
s1.x = _mm_set_ps (-24.43, 68.346, -43.35, 546.46); |
| 25 |
s2 = 0xFEDCBA9876543210; |
| 26 |
|
| 27 |
asm volatile ("" : "+m" (s2)); |
| 28 |
res.x = _mm_cvtu64_ss (s1.x, s2); |
| 29 |
asm volatile ("" : "+m" (s2)); |
| 30 |
|
| 31 |
compute_vcvtusi2ss (s1.a, s2, res_ref); |
| 32 |
|
| 33 |
if (check_union128 (res, res_ref)) |
| 34 |
abort (); |
| 35 |
} |