1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx -DNEED_IEEE754_FLOAT" } */
4 /* { dg-warning "attribute ignored" "" { target default_packed } 150 } */
5 /* { dg-message " from " "include chain" { target default_packed } 0 } */
6 
7 #include "avx-check.h"
8 
9 static void
avx_test()10 avx_test ()
11 {
12     int i;
13     union256 source1, source2;
14     int c = 1;
15     int z = 1;
16 
17     float s1[8] = {0, -5463, 86456, 0, 1234, 0, 62445, 34352};
18     float s2[8] = {0, -1223, 0,     0, 0,    1, 0,     0};
19     int   d[1];
20     int   e[1];
21 
22     source1.x = _mm256_loadu_ps(s1);
23     source2.x = _mm256_loadu_ps(s2);
24     d[0] = _mm256_testnzc_ps(source1.x, source2.x);
25 
26     e[0] = 1;
27     for (i = 0; i < 8; i++) {
28 	union ieee754_float u1, u2;
29 	u1.d = s1[i];
30 	u2.d = s2[i];
31 	if (!u1.bits.sign && u2.bits.sign)
32             c = 0;
33 	if (u1.bits.sign && u2.bits.sign)
34             z = 0;
35         }
36     e[0] = (c==0 && z==0)?1:0;
37 
38     if (checkVi (d, e, 1))
39       abort ();
40 }
41 
42