1 /* { dg-do run } */
2 /* { dg-require-effective-target f16c } */
3 /* { dg-options "-O2 -mf16c" } */
4 
5 #include "f16c-check.h"
6 
7 static void
f16c_test(void)8 f16c_test (void)
9 {
10   union256 val;
11   union128i_w res;
12   short exp[8];
13 
14   val.a[0] = 1;
15   val.a[1] = 2;
16   val.a[2] = 4;
17   val.a[3] = 8;
18   val.a[4] = -1;
19   val.a[5] = -2;
20   val.a[6] = -4;
21   val.a[7] = -8;
22 
23   exp[0] = 0x3c00;
24   exp[1] = 0x4000;
25   exp[2] = 0x4400;
26   exp[3] = 0x4800;
27   exp[4] = 0xbc00;
28   exp[5] = 0xc000;
29   exp[6] = 0xc400;
30   exp[7] = 0xc800;
31 
32   res.x = _mm256_cvtps_ph (val.x, 0);
33 
34   if (check_union128i_w (res, exp))
35     abort ();
36 }
37