| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-mavxneconvert -mf16c -O2" } */ |
| 3 |
/* { dg-require-effective-target avxneconvert } */ |
| 4 |
#define AVXNECONVERT |
| 5 |
#include <stdint.h> |
| 6 |
#include <immintrin.h> |
| 7 |
|
| 8 |
#ifndef CHECK |
| 9 |
#define CHECK "avx-check.h" |
| 10 |
#endif |
| 11 |
|
| 12 |
#ifndef TEST |
| 13 |
#define TEST avx_test |
| 14 |
#endif |
| 15 |
|
| 16 |
#include CHECK |
| 17 |
|
| 18 |
void TEST (void) |
| 19 |
{ |
| 20 |
union128 dst_128; |
| 21 |
union256 dst_256; |
| 22 |
float res_ref_128[4], res_ref_256[8], fp32; |
| 23 |
uint16_t var; |
| 24 |
fp32 = (float) 3 * 2 + 8.5; |
| 25 |
for (int i = 0; i < 4; i++) |
| 26 |
{ |
| 27 |
res_ref_128[i] = fp32; |
| 28 |
dst_128.a[i] = 117; |
| 29 |
} |
| 30 |
for (int i = 0; i < 8; i++) |
| 31 |
{ |
| 32 |
res_ref_256[i] = fp32; |
| 33 |
dst_256.a[i] = 117; |
| 34 |
} |
| 35 |
var = _cvtss_sh (fp32, 0); |
| 36 |
dst_128.x = _mm_bcstnesh_ps (&var); |
| 37 |
dst_256.x = _mm256_bcstnesh_ps (&var); |
| 38 |
if (check_union128 (dst_128, res_ref_128)) |
| 39 |
abort(); |
| 40 |
if (check_union256 (dst_256, res_ref_256)) |
| 41 |
abort(); |
| 42 |
} |