Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512fp16-vector-complex-float.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ffast-math -mavx512fp16 -mavx512vl -mprefer-vector-width=512" } */
3 /* { dg-final { scan-assembler-times "vfmaddcph\[ \\t\]" 1 } } */
4 /* { dg-final { scan-assembler-not "vfmadd\[123]*ph\[ \\t\]"} } */
5 /* { dg-final { scan-assembler-not "vfmadd\[123]*sh\[ \\t\]"} } */
6 /* { dg-final { scan-assembler-times "vfcmaddcph\[ \\t\]" 1 } } */
7 /* { dg-final { scan-assembler-times "vfmulcph\[ \\t\]" 1 } } */
8 /* { dg-final { scan-assembler-times "vfcmulcph\[ \\t\]" 1 } } */
9
10 #include<complex.h>
11 #define TYPE _Float16
12 #define N 16
13
14 void fma0 (_Complex TYPE *a, _Complex TYPE *b,
15 _Complex TYPE * __restrict c)
16 {
17 for (int i = 0; i < N; i++)
18 c[i] += a[i] * b[i];
19 }
20
21 void fmaconj (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N],
22 _Complex TYPE c[restrict N])
23 {
24 for (int i = 0; i < N; i++)
25 c[i] += a[i] * ~b[i];
26 }
27
28 void fmul (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N],
29 _Complex TYPE c[restrict N])
30 {
31 for (int i = 0; i < N; i++)
32 c[i] = a[i] * b[i];
33 }
34
35 void fmulconj (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N],
36 _Complex TYPE c[restrict N])
37 {
38 for (int i = 0; i < N; i++)
39 c[i] = a[i] * ~b[i];
40 }