annotate gcc/testsuite/gcc.target/i386/avx512bw-pr94509-2.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 /* PR target/94509 */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2 /* { dg-do run { target avx512bw } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 /* { dg-options "-O2 -mavx512bw" } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 #define AVX512BW
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 #include "avx512f-helper.h"
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 typedef unsigned char __attribute__ ((__vector_size__ (64))) V;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 __attribute__((noipa)) V
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 foo (V x)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 return __builtin_shuffle (x, (V) { 0, 1, 0, 1, 0, 1, 0, 1,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 0, 1, 0, 1, 0, 1, 0, 1,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 30, 31, 30, 31, 30, 31, 30, 31,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 30, 31, 30, 31, 30, 31, 30, 31,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17 0, 1, 0, 1, 0, 1, 0, 1,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18 0, 1, 0, 1, 0, 1, 0, 1,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 30, 31, 30, 31, 30, 31, 30, 31,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 30, 31, 30, 31, 30, 31, 30, 31 });
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
22
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
23 static void
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
24 TEST (void)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
25 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
26 V v = foo ((V) { 1, 2, 3, 4, 5, 6, 7, 8,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
27 9, 10, 11, 12, 13, 14, 15, 16,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
28 17, 18, 19, 20, 21, 22, 23, 24,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
29 25, 26, 27, 28, 29, 30, 31, 32,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
30 33, 34, 35, 36, 37, 38, 39, 40,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
31 41, 42, 43, 44, 45, 46, 47, 48,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
32 49, 50, 51, 52, 53, 54, 55, 56,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
33 57, 58, 59, 60, 61, 62, 63, 64 });
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
34 unsigned int i;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
35 for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
36 if (v[i] != ((i & 16) ? 31 : 1) + (i & 1))
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
37 abort ();
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
38 }