Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpop-check.h
blob204b11cb3e1266d90ef49a39a187a0d915093230
1 #include "avx2-check.h"
3 #define SIZE 256
5 TYPE a[SIZE];
6 TYPE b[SIZE];
7 TYPE c[SIZE];
8 volatile TYPE c_ref[SIZE];
10 __attribute__ ((__noinline__))
11 void
12 gen_pop ()
14 int i;
15 for (i = 0; i < SIZE; ++i)
16 #ifdef BIN_OP
17 c[i] = BIN_OP (a[i], b[i]);
18 #else /* Must be UN_OP */
19 c[i] = UN_OP (a[i]);
20 #endif /* BIN_OP */
23 void
24 check_pop ()
26 int i;
27 for (i = 0; i < SIZE; ++i)
28 #ifdef BIN_OP
29 c_ref[i] = BIN_OP (a[i], b[i]);
30 #else /* Must be UN_OP */
31 c_ref[i] = UN_OP (a[i]);
32 #endif /* BIN_OP */
35 void static
36 avx2_test (void)
38 int i, j;
39 for (i = 0; i < 4; ++i )
41 for ( j = 0; j < SIZE; ++j )
43 a[i] = i * i + i;
44 b[i] = i * i * i;
47 gen_pop ();
48 check_pop ();
50 /* We need to cast away volatility from c_ref here in order to eliminate
51 warning if libc version of memcpy is used here. */
52 if (memcmp (c, (void *) c_ref, SIZE * sizeof (TYPE)))
53 abort();