Debian Codegraph @

gcc/testsuite/gcc.target/i386/vec_pack_fp16-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512fp16 -mavx512vl -Ofast -mprefer-vector-width=512" } */
3 /* { dg-final { scan-assembler-times "vcvttph2dq" "2" } } */
4 /* { dg-final { scan-assembler-times "vcvtdq2ph" "2" } } */
5 /* { dg-final { scan-assembler-times "vcvtph2ps" "2" } } */
6 /* { dg-final { scan-assembler-times "vcvtps2ph" "2" } } */
7
8 void
9 foo (int* __restrict a, _Float16* b)
10 {
11 for (int i = 0; i != 1000000; i++)
12 a[i] = b[i];
13 }
14
15 void
16 foo1 (int* __restrict a, _Float16* b)
17 {
18 for (int i = 0; i != 100000; i++)
19 b[i] = a[i];
20 }
21
22 void
23 foo2 (float* __restrict a, _Float16* b)
24 {
25 for (int i = 0; i != 1000000; i++)
26 a[i] = b[i];
27 }
28
29 void
30 foo3 (float* __restrict a, _Float16* b)
31 {
32 for (int i = 0; i != 100000; i++)
33 b[i] = a[i];
34 }