PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx-vtestpd-256-3.c
blob2f76257adeffec19552eb104d0d6a93a5728bd8a
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx -DNEED_IEEE754_DOUBLE" } */
5 #include "avx-check.h"
7 static void
8 avx_test ()
10 int i;
11 union256d source1, source2;
13 double s1[4] = {0, -5463, 86456, 0};
14 double s2[4] = {0, -1223, 0, 1};
15 int d[1];
16 int e[1];
17 int c=1;
18 int z=1;
20 source1.x = _mm256_loadu_pd(s1);
21 source2.x = _mm256_loadu_pd(s2);
22 d[0] = _mm256_testnzc_pd(source1.x, source2.x);
24 e[0] = 1;
25 for (i = 0; i < 4; i++) {
26 union ieee754_double u1, u2;
27 u1.d = s1[i];
28 u2.d = s2[i];
29 if (u1.bits.sign && u2.bits.sign)
30 z = 0;
32 if (!u1.bits.sign && u2.bits.sign)
33 c = 0;
35 e[0] = (c==0 && z==0) ? 1:0;
37 if (checkVi(d, e, 1))
38 abort ();