Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bfcvt-compile.c

raw
1 /* { dg-do assemble { target { aarch64*-*-* } } } */
2 /* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
3 /* { dg-add-options arm_v8_2a_bf16_neon } */
4 /* { dg-additional-options "-save-temps" } */
5 /* { dg-final { check-function-bodies "**" "" {-O[^0]} } } */
6 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */
7
8 #include <arm_neon.h>
9
10 /*
11 **test_bfcvtn:
12 ** bfcvtn v0.4h, v0.4s
13 ** ret
14 */
15 bfloat16x4_t test_bfcvtn (float32x4_t a)
16 {
17 return vcvt_bf16_f32 (a);
18 }
19
20 /*
21 **test_bfcvtnq:
22 ** bfcvtn v0.4h, v0.4s
23 ** ret
24 */
25 bfloat16x8_t test_bfcvtnq (float32x4_t a)
26 {
27 return vcvtq_low_bf16_f32 (a);
28 }
29
30 /*
31 **test_bfcvtnq2:
32 ** bfcvtn2 v0.8h, v1.4s
33 ** ret
34 */
35 bfloat16x8_t test_bfcvtnq2 (bfloat16x8_t inactive, float32x4_t a)
36 {
37 return vcvtq_high_bf16_f32 (inactive, a);
38 }
39
40 /*
41 **test_bfcvt:
42 ** bfcvt h0, s0
43 ** ret
44 */
45 bfloat16_t test_bfcvt (float32_t a)
46 {
47 return vcvth_bf16_f32 (a);
48 }
49
50 /*
51 **test_vcvt_f32_bf16:
52 ** shll v0.4s, v0.4h, #16
53 ** ret
54 */
55 float32x4_t test_vcvt_f32_bf16 (bfloat16x4_t a)
56 {
57 return vcvt_f32_bf16 (a);
58 }
59
60 /*
61 **test_vcvtq_low_f32_bf16:
62 ** shll v0.4s, v0.4h, #16
63 ** ret
64 */
65 float32x4_t test_vcvtq_low_f32_bf16 (bfloat16x8_t a)
66 {
67 return vcvtq_low_f32_bf16 (a);
68 }
69
70 /*
71 **test_vcvtq_high_f32_bf16:
72 ** shll2 v0.4s, v0.8h, #16
73 ** ret
74 */
75 float32x4_t test_vcvtq_high_f32_bf16 (bfloat16x8_t a)
76 {
77 return vcvtq_high_f32_bf16 (a);
78 }
79
80 /*
81 **test_vcvtah_f32_bf16:
82 ** shl d0, d0, #16
83 ** ret
84 */
85 float32_t test_vcvtah_f32_bf16 (bfloat16_t a)
86 {
87 return vcvtah_f32_bf16 (a);
88 }