annotate gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bf16_dup.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 /* { dg-do assemble { target { aarch64*-*-* } } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2 /* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 /* { dg-options "-O2" } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 /* { dg-add-options arm_v8_2a_bf16_neon } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 /* { dg-additional-options "-save-temps" } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 #include <arm_neon.h>
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9 float32x2_t test_vcreate (float32x2_t r, uint64_t a, uint64_t b)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 bfloat16x4_t _a = vcreate_bf16(a);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 bfloat16x4_t _b = vcreate_bf16(b);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 return vbfdot_f32 (r, _a, _b);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 /* { dg-final { scan-assembler {bfdot\tv[0-9]+.2s, v[0-9]+.4h, v[0-9]+.4h} } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18 bfloat16x4_t test_vset_lane_bf16 (bfloat16_t a, bfloat16x4_t b)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 return vset_lane_bf16 (a, b, 3);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
22
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
23 bfloat16x8_t test_vsetq_lane_bf16 (bfloat16_t a, bfloat16x8_t b)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
24 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
25 return vsetq_lane_bf16 (a, b, 7);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
26 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
27 /* { dg-final { scan-assembler-times "ins\\t" 2 } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
28
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
29 bfloat16x4_t vdup_test (bfloat16_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
30 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
31 return vdup_n_bf16 (a);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
32 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
33 /* { dg-final { scan-assembler "dup\\tv\[0-9\]+\.4h, v\[0-9\]+.h\\\[0\\\]" } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
34
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
35 bfloat16x8_t vdupq_test (bfloat16_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
36 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
37 return vdupq_n_bf16 (a);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
38 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
39
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
40 bfloat16x8_t test_vdupq_lane_bf16 (bfloat16x4_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
41 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
42 return vdupq_lane_bf16 (a, 1);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
43 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
44 /* { dg-final { scan-assembler-times "dup\\tv\[0-9\]+\.8h, v\[0-9\]+.h\\\[0\\\]" 2 } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
45
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
46 bfloat16_t test_vget_lane_bf16 (bfloat16x4_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
47 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
48 return vget_lane_bf16 (a, 1);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
49 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
50 /* { dg-final { scan-assembler-times "dup\\th\[0-9\]+, v\[0-9\]+\.h\\\[1\\\]" 2 } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
51
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
52 bfloat16x4_t test_vdup_lane_bf16 (bfloat16x4_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
53 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
54 return vdup_lane_bf16 (a, 1);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
55 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
56 /* { dg-final { scan-assembler "dup\\tv\[0-9\]+\.4h, v\[0-9\]+\.h\\\[1\\\]" } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
57
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
58 bfloat16x4_t test_vdup_laneq_bf16 (bfloat16x8_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
59 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
60 return vdup_laneq_bf16 (a, 7);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
61 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
62 /* { dg-final { scan-assembler "dup\\tv\[0-9\]+\.8h, v\[0-9\]+\.h\\\[7\\\]" } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
63
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
64 bfloat16x8_t test_vdupq_laneq_bf16 (bfloat16x8_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
65 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
66 return vdupq_laneq_bf16 (a, 5);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
67 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
68 /* { dg-final { scan-assembler "dup\\tv\[0-9\]+\.8h, v\[0-9\]+\.h\\\[5\\\]" } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
69
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
70 bfloat16_t test_vduph_lane_bf16 (bfloat16x4_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
71 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
72 return vduph_lane_bf16 (a, 3);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
73 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
74 /* { dg-final { scan-assembler "dup\\th\[0-9\]+, v\[0-9\]+\.h\\\[3\\\]" } } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
75
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
76 bfloat16_t test_vgetq_lane_bf16 (bfloat16x8_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
77 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
78 return vgetq_lane_bf16 (a, 7);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
79 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
80
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
81 bfloat16_t test_vduph_laneq_bf16 (bfloat16x8_t a)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
82 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
83 return vduph_laneq_bf16 (a, 7);
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
84 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
85 /* { dg-final { scan-assembler-times "dup\\th\[0-9\]+, v\[0-9\]+\.h\\\[7\\\]" 2 } } */