Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx10_2-512-bf16-vector-fma-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=x86-64-v3 -mavx10.2 -O2" } */
3 /* { dg-final { scan-assembler-times "vfmadd132bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
4 /* { dg-final { scan-assembler-times "vfmsub132bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
5 /* { dg-final { scan-assembler-times "vfnmadd132bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
6 /* { dg-final { scan-assembler-times "vfnmsub132bf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
7
8 #include <immintrin.h>
9
10 typedef __bf16 v32bf __attribute__ ((__vector_size__ (64)));
11
12 v32bf
13 foo_madd (v32bf a, v32bf b, v32bf c)
14 {
15 return a * b + c;
16 }
17
18 v32bf
19 foo_msub (v32bf a, v32bf b, v32bf c)
20 {
21 return a * b - c;
22 }
23
24 v32bf
25 foo_nmadd (v32bf a, v32bf b, v32bf c)
26 {
27 return -a * b + c;
28 }
29
30 v32bf
31 foo_nmsub (v32bf a, v32bf b, v32bf c)
32 {
33 return -a * b - c;
34 }