Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr105033.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=sapphirerapids -O2" } */
3 /* { dg-final { scan-assembler-times {vpunpcklqdq[ \t]+} 3 { target { ! ia32 } } } } */
4 /* { dg-final { scan-assembler-times {vpunpcklqdq[ \t]+} 2 { target ia32 } } } */
5 /* { dg-final { scan-assembler-times {vmovhps[ \t]+} 1 { target ia32 } } } */
6 /* { dg-final { scan-assembler-not {vpermi2[wb][ \t]+} } } */
7
8 typedef _Float16 v8hf __attribute__((vector_size (16)));
9 typedef _Float16 v4hf __attribute__((vector_size (8)));
10 typedef short v8hi __attribute__((vector_size (16)));
11 typedef short v4hi __attribute__((vector_size (8)));
12 typedef char v16qi __attribute__((vector_size (16)));
13 typedef char v8qi __attribute__((vector_size (8)));
14
15 v8hf foo (v4hf a, v4hf b)
16 {
17 return __builtin_shufflevector (a, b, 0, 1, 2, 3, 4, 5, 6, 7);
18 }
19
20 v8hi foo2 (v4hi a, v4hi b)
21 {
22 return __builtin_shufflevector (a, b, 0, 1, 2, 3, 4, 5, 6, 7);
23 }
24
25 v16qi foo3 (v8qi a, v8qi b)
26 {
27 return __builtin_shufflevector (a, b, 0, 1, 2, 3, 4, 5, 6, 7,
28 8, 9, 10, 11, 12, 13, 14, 15);
29 }