Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512bw-truncsfbf.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512bw -mavx512vl -mno-avx512bf16 -mno-avxneconvert -O2 -ffast-math" } */
3 /* { dg-final { scan-assembler-times {(?n)(?:vpermw|vpshufb)} 6 } } */
4
5 typedef float v4sf __attribute__((vector_size(16)));
6 typedef float v8sf __attribute__((vector_size(32)));
7 typedef float v16sf __attribute__((vector_size(64)));
8 typedef __bf16 v4bf __attribute__((vector_size(8)));
9 typedef __bf16 v8bf __attribute__((vector_size(16)));
10 typedef __bf16 v16bf __attribute__((vector_size(32)));
11
12 v4bf
13 foo (v4sf b, v4sf a)
14 {
15 return __builtin_convertvector (a, v4bf);
16 }
17
18 v8bf
19 foo2 (v8sf b, v8sf a)
20 {
21 return __builtin_convertvector (a, v8bf);
22 }
23
24 v16bf
25 foo3 (v16sf b, v16sf a)
26 {
27 return __builtin_convertvector (a, v16bf);
28 }
29
30 v4bf
31 foo_mem (v4sf* a)
32 {
33 return __builtin_convertvector (*a, v4bf);
34 }
35
36 v8bf
37 foo2_mem (v8sf* a)
38 {
39 return __builtin_convertvector (*a, v8bf);
40 }
41
42 v16bf
43 foo3_mem (v16sf* a)
44 {
45 return __builtin_convertvector (*a, v16bf);
46 }