PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx-vtestps-256-3.c
bloba0286b2772052d9a59413166d7d026bd7ca64b0f
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx -DNEED_IEEE754_FLOAT" } */
5 #include "avx-check.h"
7 static void
8 avx_test ()
10 int i;
11 union256 source1, source2;
12 int c = 1;
13 int z = 1;
15 float s1[8] = {0, -5463, 86456, 0, 1234, 0, 62445, 34352};
16 float s2[8] = {0, -1223, 0, 0, 0, 1, 0, 0};
17 int d[1];
18 int e[1];
20 source1.x = _mm256_loadu_ps(s1);
21 source2.x = _mm256_loadu_ps(s2);
22 d[0] = _mm256_testnzc_ps(source1.x, source2.x);
24 e[0] = 1;
25 for (i = 0; i < 8; i++) {
26 union ieee754_float u1, u2;
27 u1.d = s1[i];
28 u2.d = s2[i];
29 if (!u1.bits.sign && u2.bits.sign)
30 c = 0;
31 if (u1.bits.sign && u2.bits.sign)
32 z = 0;
34 e[0] = (c==0 && z==0)?1:0;
36 if (checkVi (d, e, 1))
37 abort ();