| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ |
| 3 |
/* { dg-require-effective-target avx10_2 } */ |
| 4 |
|
| 5 |
#define AVX10_2 |
| 6 |
#define AVX10_SCALAR |
| 7 |
#include "avx10-helper.h" |
| 8 |
#include <limits.h> |
| 9 |
|
| 10 |
void |
| 11 |
TEST (void) |
| 12 |
{ |
| 13 |
UNION_TYPE (128, d) s; |
| 14 |
int res1; |
| 15 |
long long res2; |
| 16 |
int res1_ref = 0; |
| 17 |
long long res2_ref = 0; |
| 18 |
int i, sign = 1; |
| 19 |
|
| 20 |
s.a[0] = 2.46; |
| 21 |
|
| 22 |
res1 = _mm_cvtts_roundsd_epi32 (s.x, 8); |
| 23 |
|
| 24 |
if (s.a[0] > INT_MAX) |
| 25 |
res1_ref = INT_MAX; |
| 26 |
else if (s.a[0] < INT_MIN) |
| 27 |
res1_ref = INT_MIN; |
| 28 |
else |
| 29 |
res1_ref = s.a[0]; |
| 30 |
|
| 31 |
if (res1 != res1_ref) |
| 32 |
abort(); |
| 33 |
|
| 34 |
res1 = _mm_cvtts_sd_epi32 (s.x); |
| 35 |
|
| 36 |
if (s.a[0] > INT_MAX) |
| 37 |
res1_ref = INT_MAX; |
| 38 |
else if (s.a[0] < INT_MIN) |
| 39 |
res1_ref = INT_MIN; |
| 40 |
else |
| 41 |
res1_ref = s.a[0]; |
| 42 |
|
| 43 |
if (res1 != res1_ref) |
| 44 |
abort(); |
| 45 |
|
| 46 |
#ifdef __x86_64__ |
| 47 |
res2 = _mm_cvtts_roundsd_epi64 (s.x, 8); |
| 48 |
|
| 49 |
if (s.a[0] > LLONG_MAX) |
| 50 |
res2_ref = LLONG_MAX; |
| 51 |
else if (s.a[0] < LLONG_MIN) |
| 52 |
res2_ref = LLONG_MIN; |
| 53 |
else |
| 54 |
res2_ref = s.a[0]; |
| 55 |
|
| 56 |
if (res2 != res2_ref) |
| 57 |
abort(); |
| 58 |
|
| 59 |
res2 = _mm_cvtts_sd_epi64 (s.x); |
| 60 |
|
| 61 |
if (s.a[0] > LLONG_MAX) |
| 62 |
res2_ref = LLONG_MAX; |
| 63 |
else if (s.a[0] < LLONG_MIN) |
| 64 |
res2_ref = LLONG_MIN; |
| 65 |
else |
| 66 |
res2_ref = s.a[0]; |
| 67 |
|
| 68 |
if (res2 != res2_ref) |
| 69 |
abort(); |
| 70 |
#endif |
| 71 |
} |