Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/pcs/gnu_vectors_1.c

raw
1 /* { dg-options "-O -msve-vector-bits=256 -fomit-frame-pointer" } */
2
3 #include <arm_sve.h>
4
5 typedef mfloat8_t mfloat8x32_t __attribute__((vector_size (32)));
6 typedef bfloat16_t bfloat16x16_t __attribute__((vector_size (32)));
7 typedef float16_t float16x16_t __attribute__((vector_size (32)));
8 typedef float32_t float32x8_t __attribute__((vector_size (32)));
9 typedef float64_t float64x4_t __attribute__((vector_size (32)));
10 typedef int8_t int8x32_t __attribute__((vector_size (32)));
11 typedef int16_t int16x16_t __attribute__((vector_size (32)));
12 typedef int32_t int32x8_t __attribute__((vector_size (32)));
13 typedef int64_t int64x4_t __attribute__((vector_size (32)));
14 typedef uint8_t uint8x32_t __attribute__((vector_size (32)));
15 typedef uint16_t uint16x16_t __attribute__((vector_size (32)));
16 typedef uint32_t uint32x8_t __attribute__((vector_size (32)));
17 typedef uint64_t uint64x4_t __attribute__((vector_size (32)));
18
19 void mfloat8_callee (mfloat8x32_t);
20 void bfloat16_callee (bfloat16x16_t);
21 void float16_callee (float16x16_t);
22 void float32_callee (float32x8_t);
23 void float64_callee (float64x4_t);
24 void int8_callee (int8x32_t);
25 void int16_callee (int16x16_t);
26 void int32_callee (int32x8_t);
27 void int64_callee (int64x4_t);
28 void uint8_callee (uint8x32_t);
29 void uint16_callee (uint16x16_t);
30 void uint32_callee (uint32x8_t);
31 void uint64_callee (uint64x4_t);
32
33 void
34 mfloat8_caller (mfloat8_t val)
35 {
36 mfloat8_callee (svdup_mf8 (val));
37 }
38
39 void
40 bfloat16_caller (bfloat16_t val)
41 {
42 bfloat16_callee (svdup_bf16 (val));
43 }
44
45 void
46 float16_caller (void)
47 {
48 float16_callee (svdup_f16 (1.0));
49 }
50
51 void
52 float32_caller (void)
53 {
54 float32_callee (svdup_f32 (2.0));
55 }
56
57 void
58 float64_caller (void)
59 {
60 float64_callee (svdup_f64 (3.0));
61 }
62
63 void
64 int8_caller (void)
65 {
66 int8_callee (svindex_s8 (0, 1));
67 }
68
69 void
70 int16_caller (void)
71 {
72 int16_callee (svindex_s16 (0, 2));
73 }
74
75 void
76 int32_caller (void)
77 {
78 int32_callee (svindex_s32 (0, 3));
79 }
80
81 void
82 int64_caller (void)
83 {
84 int64_callee (svindex_s64 (0, 4));
85 }
86
87 void
88 uint8_caller (void)
89 {
90 uint8_callee (svindex_u8 (1, 1));
91 }
92
93 void
94 uint16_caller (void)
95 {
96 uint16_callee (svindex_u16 (1, 2));
97 }
98
99 void
100 uint32_caller (void)
101 {
102 uint32_callee (svindex_u32 (1, 3));
103 }
104
105 void
106 uint64_caller (void)
107 {
108 uint64_callee (svindex_u64 (1, 4));
109 }
110
111 /* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.b, p[0-7], \[x0\]} 3 } } */
112 /* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h, p[0-7], \[x0\]} 4 } } */
113 /* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s, p[0-7], \[x0\]} 3 } } */
114 /* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d, p[0-7], \[x0\]} 3 } } */
115 /* { dg-final { scan-assembler-times {\tadd\tx0, sp, #?16\n} 13 } } */