Debian Codegraph @

clang/test/CodeGen/AArch64/bf16-reinterpret-intrinsics.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -triple aarch64 -target-feature +neon -target-feature +bf16 \
3 // RUN: -disable-O0-optnone -emit-llvm -o - %s \
4 // RUN: | opt -S -passes=mem2reg,sroa \
5 // RUN: | FileCheck %s
6
7 // REQUIRES: aarch64-registered-target
8
9 #include <arm_neon.h>
10
11 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_s8(
12 // CHECK-SAME: <8 x i8> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
13 // CHECK-NEXT: [[ENTRY:.*:]]
14 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i8> [[A]] to <4 x i16>
15 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <4 x bfloat>
16 // CHECK-NEXT: ret <4 x bfloat> [[TMP1]]
17 //
18 bfloat16x4_t test_vreinterpret_bf16_s8(int8x8_t a) { return vreinterpret_bf16_s8(a); }
19 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_s16(
20 // CHECK-SAME: <4 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
21 // CHECK-NEXT: [[ENTRY:.*:]]
22 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i16> [[A]] to <4 x bfloat>
23 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
24 //
25 bfloat16x4_t test_vreinterpret_bf16_s16(int16x4_t a) { return vreinterpret_bf16_s16(a); }
26 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_s32(
27 // CHECK-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] {
28 // CHECK-NEXT: [[ENTRY:.*:]]
29 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i32> [[A]] to <4 x bfloat>
30 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
31 //
32 bfloat16x4_t test_vreinterpret_bf16_s32(int32x2_t a) { return vreinterpret_bf16_s32(a); }
33 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_f32(
34 // CHECK-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
35 // CHECK-NEXT: [[ENTRY:.*:]]
36 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
37 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <4 x bfloat>
38 // CHECK-NEXT: ret <4 x bfloat> [[TMP1]]
39 //
40 bfloat16x4_t test_vreinterpret_bf16_f32(float32x2_t a) { return vreinterpret_bf16_f32(a); }
41 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_u8(
42 // CHECK-SAME: <8 x i8> noundef [[A:%.*]]) #[[ATTR0]] {
43 // CHECK-NEXT: [[ENTRY:.*:]]
44 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i8> [[A]] to <4 x i16>
45 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <4 x bfloat>
46 // CHECK-NEXT: ret <4 x bfloat> [[TMP1]]
47 //
48 bfloat16x4_t test_vreinterpret_bf16_u8(uint8x8_t a) { return vreinterpret_bf16_u8(a); }
49 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_u16(
50 // CHECK-SAME: <4 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
51 // CHECK-NEXT: [[ENTRY:.*:]]
52 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i16> [[A]] to <4 x bfloat>
53 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
54 //
55 bfloat16x4_t test_vreinterpret_bf16_u16(uint16x4_t a) { return vreinterpret_bf16_u16(a); }
56 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_u32(
57 // CHECK-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] {
58 // CHECK-NEXT: [[ENTRY:.*:]]
59 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i32> [[A]] to <4 x bfloat>
60 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
61 //
62 bfloat16x4_t test_vreinterpret_bf16_u32(uint32x2_t a) { return vreinterpret_bf16_u32(a); }
63 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_p8(
64 // CHECK-SAME: <8 x i8> noundef [[A:%.*]]) #[[ATTR0]] {
65 // CHECK-NEXT: [[ENTRY:.*:]]
66 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i8> [[A]] to <4 x i16>
67 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <4 x bfloat>
68 // CHECK-NEXT: ret <4 x bfloat> [[TMP1]]
69 //
70 bfloat16x4_t test_vreinterpret_bf16_p8(poly8x8_t a) { return vreinterpret_bf16_p8(a); }
71 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_p16(
72 // CHECK-SAME: <4 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
73 // CHECK-NEXT: [[ENTRY:.*:]]
74 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i16> [[A]] to <4 x bfloat>
75 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
76 //
77 bfloat16x4_t test_vreinterpret_bf16_p16(poly16x4_t a) { return vreinterpret_bf16_p16(a); }
78 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_u64(
79 // CHECK-SAME: <1 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
80 // CHECK-NEXT: [[ENTRY:.*:]]
81 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <1 x i64> [[A]] to <4 x bfloat>
82 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
83 //
84 bfloat16x4_t test_vreinterpret_bf16_u64(uint64x1_t a) { return vreinterpret_bf16_u64(a); }
85 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_s64(
86 // CHECK-SAME: <1 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
87 // CHECK-NEXT: [[ENTRY:.*:]]
88 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <1 x i64> [[A]] to <4 x bfloat>
89 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
90 //
91 bfloat16x4_t test_vreinterpret_bf16_s64(int64x1_t a) { return vreinterpret_bf16_s64(a); }
92 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_s8(
93 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) #[[ATTR0]] {
94 // CHECK-NEXT: [[ENTRY:.*:]]
95 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A]] to <8 x i16>
96 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <8 x bfloat>
97 // CHECK-NEXT: ret <8 x bfloat> [[TMP1]]
98 //
99 bfloat16x8_t test_vreinterpretq_bf16_s8(int8x16_t a) { return vreinterpretq_bf16_s8(a); }
100 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_s16(
101 // CHECK-SAME: <8 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
102 // CHECK-NEXT: [[ENTRY:.*:]]
103 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A]] to <8 x bfloat>
104 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
105 //
106 bfloat16x8_t test_vreinterpretq_bf16_s16(int16x8_t a) { return vreinterpretq_bf16_s16(a); }
107 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_s32(
108 // CHECK-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] {
109 // CHECK-NEXT: [[ENTRY:.*:]]
110 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x bfloat>
111 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
112 //
113 bfloat16x8_t test_vreinterpretq_bf16_s32(int32x4_t a) { return vreinterpretq_bf16_s32(a); }
114 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_f32(
115 // CHECK-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
116 // CHECK-NEXT: [[ENTRY:.*:]]
117 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
118 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <8 x bfloat>
119 // CHECK-NEXT: ret <8 x bfloat> [[TMP1]]
120 //
121 bfloat16x8_t test_vreinterpretq_bf16_f32(float32x4_t a) { return vreinterpretq_bf16_f32(a); }
122 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_u8(
123 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) #[[ATTR0]] {
124 // CHECK-NEXT: [[ENTRY:.*:]]
125 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A]] to <8 x i16>
126 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <8 x bfloat>
127 // CHECK-NEXT: ret <8 x bfloat> [[TMP1]]
128 //
129 bfloat16x8_t test_vreinterpretq_bf16_u8(uint8x16_t a) { return vreinterpretq_bf16_u8(a); }
130 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_u16(
131 // CHECK-SAME: <8 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
132 // CHECK-NEXT: [[ENTRY:.*:]]
133 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A]] to <8 x bfloat>
134 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
135 //
136 bfloat16x8_t test_vreinterpretq_bf16_u16(uint16x8_t a) { return vreinterpretq_bf16_u16(a); }
137 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_u32(
138 // CHECK-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] {
139 // CHECK-NEXT: [[ENTRY:.*:]]
140 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x bfloat>
141 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
142 //
143 bfloat16x8_t test_vreinterpretq_bf16_u32(uint32x4_t a) { return vreinterpretq_bf16_u32(a); }
144 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_p8(
145 // CHECK-SAME: <16 x i8> noundef [[A:%.*]]) #[[ATTR0]] {
146 // CHECK-NEXT: [[ENTRY:.*:]]
147 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A]] to <8 x i16>
148 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <8 x bfloat>
149 // CHECK-NEXT: ret <8 x bfloat> [[TMP1]]
150 //
151 bfloat16x8_t test_vreinterpretq_bf16_p8(poly8x16_t a) { return vreinterpretq_bf16_p8(a); }
152 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_p16(
153 // CHECK-SAME: <8 x i16> noundef [[A:%.*]]) #[[ATTR0]] {
154 // CHECK-NEXT: [[ENTRY:.*:]]
155 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A]] to <8 x bfloat>
156 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
157 //
158 bfloat16x8_t test_vreinterpretq_bf16_p16(poly16x8_t a) { return vreinterpretq_bf16_p16(a); }
159 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_u64(
160 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
161 // CHECK-NEXT: [[ENTRY:.*:]]
162 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A]] to <8 x bfloat>
163 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
164 //
165 bfloat16x8_t test_vreinterpretq_bf16_u64(uint64x2_t a) { return vreinterpretq_bf16_u64(a); }
166 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_s64(
167 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
168 // CHECK-NEXT: [[ENTRY:.*:]]
169 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A]] to <8 x bfloat>
170 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
171 //
172 bfloat16x8_t test_vreinterpretq_bf16_s64(int64x2_t a) { return vreinterpretq_bf16_s64(a); }
173 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_p64(
174 // CHECK-SAME: <1 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
175 // CHECK-NEXT: [[ENTRY:.*:]]
176 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <1 x i64> [[A]] to <4 x bfloat>
177 // CHECK-NEXT: ret <4 x bfloat> [[TMP0]]
178 //
179 bfloat16x4_t test_vreinterpret_bf16_p64(poly64x1_t a) { return vreinterpret_bf16_p64(a); }
180 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_p64(
181 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
182 // CHECK-NEXT: [[ENTRY:.*:]]
183 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A]] to <8 x bfloat>
184 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
185 //
186 bfloat16x8_t test_vreinterpretq_bf16_p64(poly64x2_t a) { return vreinterpretq_bf16_p64(a); }
187 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_p128(
188 // CHECK-SAME: i128 noundef [[A:%.*]]) #[[ATTR0]] {
189 // CHECK-NEXT: [[ENTRY:.*:]]
190 // CHECK-NEXT: [[TMP0:%.*]] = bitcast i128 [[A]] to <8 x bfloat>
191 // CHECK-NEXT: ret <8 x bfloat> [[TMP0]]
192 //
193 bfloat16x8_t test_vreinterpretq_bf16_p128(poly128_t a) { return vreinterpretq_bf16_p128(a); }
194 // CHECK-LABEL: define dso_local <4 x bfloat> @test_vreinterpret_bf16_f64(
195 // CHECK-SAME: <1 x double> noundef [[A:%.*]]) #[[ATTR0]] {
196 // CHECK-NEXT: [[ENTRY:.*:]]
197 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <1 x double> [[A]] to i64
198 // CHECK-NEXT: [[__P0_ADDR_I_SROA_0_0_VEC_INSERT:%.*]] = insertelement <1 x i64> undef, i64 [[TMP0]], i32 0
199 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <1 x i64> [[__P0_ADDR_I_SROA_0_0_VEC_INSERT]] to <4 x bfloat>
200 // CHECK-NEXT: ret <4 x bfloat> [[TMP1]]
201 //
202 bfloat16x4_t test_vreinterpret_bf16_f64(float64x1_t a) { return vreinterpret_bf16_f64(a); }
203 // CHECK-LABEL: define dso_local <8 x bfloat> @test_vreinterpretq_bf16_f64(
204 // CHECK-SAME: <2 x double> noundef [[A:%.*]]) #[[ATTR0]] {
205 // CHECK-NEXT: [[ENTRY:.*:]]
206 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[A]] to <2 x i64>
207 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[TMP0]] to <8 x bfloat>
208 // CHECK-NEXT: ret <8 x bfloat> [[TMP1]]
209 //
210 bfloat16x8_t test_vreinterpretq_bf16_f64(float64x2_t a) { return vreinterpretq_bf16_f64(a); }
211 // CHECK-LABEL: define dso_local <8 x i8> @test_vreinterpret_s8_bf16(
212 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
213 // CHECK-NEXT: [[ENTRY:.*:]]
214 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
215 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <8 x i8>
216 // CHECK-NEXT: ret <8 x i8> [[TMP1]]
217 //
218 int8x8_t test_vreinterpret_s8_bf16(bfloat16x4_t a) { return vreinterpret_s8_bf16(a); }
219 // CHECK-LABEL: define dso_local <4 x i16> @test_vreinterpret_s16_bf16(
220 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
221 // CHECK-NEXT: [[ENTRY:.*:]]
222 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
223 // CHECK-NEXT: ret <4 x i16> [[TMP0]]
224 //
225 int16x4_t test_vreinterpret_s16_bf16(bfloat16x4_t a) { return vreinterpret_s16_bf16(a); }
226 // CHECK-LABEL: define dso_local <2 x i32> @test_vreinterpret_s32_bf16(
227 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
228 // CHECK-NEXT: [[ENTRY:.*:]]
229 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <2 x i32>
230 // CHECK-NEXT: ret <2 x i32> [[TMP0]]
231 //
232 int32x2_t test_vreinterpret_s32_bf16(bfloat16x4_t a) { return vreinterpret_s32_bf16(a); }
233 // CHECK-LABEL: define dso_local <2 x float> @test_vreinterpret_f32_bf16(
234 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
235 // CHECK-NEXT: [[ENTRY:.*:]]
236 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <2 x i32>
237 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <2 x float>
238 // CHECK-NEXT: ret <2 x float> [[TMP1]]
239 //
240 float32x2_t test_vreinterpret_f32_bf16(bfloat16x4_t a) { return vreinterpret_f32_bf16(a); }
241 // CHECK-LABEL: define dso_local <8 x i8> @test_vreinterpret_u8_bf16(
242 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
243 // CHECK-NEXT: [[ENTRY:.*:]]
244 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
245 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <8 x i8>
246 // CHECK-NEXT: ret <8 x i8> [[TMP1]]
247 //
248 uint8x8_t test_vreinterpret_u8_bf16(bfloat16x4_t a) { return vreinterpret_u8_bf16(a); }
249 // CHECK-LABEL: define dso_local <4 x i16> @test_vreinterpret_u16_bf16(
250 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
251 // CHECK-NEXT: [[ENTRY:.*:]]
252 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
253 // CHECK-NEXT: ret <4 x i16> [[TMP0]]
254 //
255 uint16x4_t test_vreinterpret_u16_bf16(bfloat16x4_t a) { return vreinterpret_u16_bf16(a); }
256 // CHECK-LABEL: define dso_local <2 x i32> @test_vreinterpret_u32_bf16(
257 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
258 // CHECK-NEXT: [[ENTRY:.*:]]
259 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <2 x i32>
260 // CHECK-NEXT: ret <2 x i32> [[TMP0]]
261 //
262 uint32x2_t test_vreinterpret_u32_bf16(bfloat16x4_t a) { return vreinterpret_u32_bf16(a); }
263 // CHECK-LABEL: define dso_local <8 x i8> @test_vreinterpret_p8_bf16(
264 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
265 // CHECK-NEXT: [[ENTRY:.*:]]
266 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
267 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <8 x i8>
268 // CHECK-NEXT: ret <8 x i8> [[TMP1]]
269 //
270 poly8x8_t test_vreinterpret_p8_bf16(bfloat16x4_t a) { return vreinterpret_p8_bf16(a); }
271 // CHECK-LABEL: define dso_local <4 x i16> @test_vreinterpret_p16_bf16(
272 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
273 // CHECK-NEXT: [[ENTRY:.*:]]
274 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to <4 x i16>
275 // CHECK-NEXT: ret <4 x i16> [[TMP0]]
276 //
277 poly16x4_t test_vreinterpret_p16_bf16(bfloat16x4_t a) { return vreinterpret_p16_bf16(a); }
278 // CHECK-LABEL: define dso_local <1 x i64> @test_vreinterpret_u64_bf16(
279 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
280 // CHECK-NEXT: [[ENTRY:.*:]]
281 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to i64
282 // CHECK-NEXT: [[__P0_ADDR_I_SROA_0_0_VEC_INSERT:%.*]] = insertelement <1 x i64> undef, i64 [[TMP0]], i32 0
283 // CHECK-NEXT: ret <1 x i64> [[__P0_ADDR_I_SROA_0_0_VEC_INSERT]]
284 //
285 uint64x1_t test_vreinterpret_u64_bf16(bfloat16x4_t a) { return vreinterpret_u64_bf16(a); }
286 // CHECK-LABEL: define dso_local <1 x i64> @test_vreinterpret_s64_bf16(
287 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
288 // CHECK-NEXT: [[ENTRY:.*:]]
289 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to i64
290 // CHECK-NEXT: [[__P0_ADDR_I_SROA_0_0_VEC_INSERT:%.*]] = insertelement <1 x i64> undef, i64 [[TMP0]], i32 0
291 // CHECK-NEXT: ret <1 x i64> [[__P0_ADDR_I_SROA_0_0_VEC_INSERT]]
292 //
293 int64x1_t test_vreinterpret_s64_bf16(bfloat16x4_t a) { return vreinterpret_s64_bf16(a); }
294 // CHECK-LABEL: define dso_local <1 x i64> @test_vreinterpret_p64_bf16(
295 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
296 // CHECK-NEXT: [[ENTRY:.*:]]
297 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to i64
298 // CHECK-NEXT: [[__P0_ADDR_I_SROA_0_0_VEC_INSERT:%.*]] = insertelement <1 x i64> undef, i64 [[TMP0]], i32 0
299 // CHECK-NEXT: ret <1 x i64> [[__P0_ADDR_I_SROA_0_0_VEC_INSERT]]
300 //
301 poly64x1_t test_vreinterpret_p64_bf16(bfloat16x4_t a) { return vreinterpret_p64_bf16(a); }
302 // CHECK-LABEL: define dso_local <16 x i8> @test_vreinterpretq_s8_bf16(
303 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
304 // CHECK-NEXT: [[ENTRY:.*:]]
305 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
306 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <16 x i8>
307 // CHECK-NEXT: ret <16 x i8> [[TMP1]]
308 //
309 int8x16_t test_vreinterpretq_s8_bf16(bfloat16x8_t a) { return vreinterpretq_s8_bf16(a); }
310 // CHECK-LABEL: define dso_local <8 x i16> @test_vreinterpretq_s16_bf16(
311 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
312 // CHECK-NEXT: [[ENTRY:.*:]]
313 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
314 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
315 //
316 int16x8_t test_vreinterpretq_s16_bf16(bfloat16x8_t a) { return vreinterpretq_s16_bf16(a); }
317 // CHECK-LABEL: define dso_local <4 x i32> @test_vreinterpretq_s32_bf16(
318 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
319 // CHECK-NEXT: [[ENTRY:.*:]]
320 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <4 x i32>
321 // CHECK-NEXT: ret <4 x i32> [[TMP0]]
322 //
323 int32x4_t test_vreinterpretq_s32_bf16(bfloat16x8_t a) { return vreinterpretq_s32_bf16(a); }
324 // CHECK-LABEL: define dso_local <4 x float> @test_vreinterpretq_f32_bf16(
325 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
326 // CHECK-NEXT: [[ENTRY:.*:]]
327 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <4 x i32>
328 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <4 x float>
329 // CHECK-NEXT: ret <4 x float> [[TMP1]]
330 //
331 float32x4_t test_vreinterpretq_f32_bf16(bfloat16x8_t a) { return vreinterpretq_f32_bf16(a); }
332 // CHECK-LABEL: define dso_local <16 x i8> @test_vreinterpretq_u8_bf16(
333 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
334 // CHECK-NEXT: [[ENTRY:.*:]]
335 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
336 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <16 x i8>
337 // CHECK-NEXT: ret <16 x i8> [[TMP1]]
338 //
339 uint8x16_t test_vreinterpretq_u8_bf16(bfloat16x8_t a) { return vreinterpretq_u8_bf16(a); }
340 // CHECK-LABEL: define dso_local <8 x i16> @test_vreinterpretq_u16_bf16(
341 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
342 // CHECK-NEXT: [[ENTRY:.*:]]
343 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
344 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
345 //
346 uint16x8_t test_vreinterpretq_u16_bf16(bfloat16x8_t a) { return vreinterpretq_u16_bf16(a); }
347 // CHECK-LABEL: define dso_local <4 x i32> @test_vreinterpretq_u32_bf16(
348 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
349 // CHECK-NEXT: [[ENTRY:.*:]]
350 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <4 x i32>
351 // CHECK-NEXT: ret <4 x i32> [[TMP0]]
352 //
353 uint32x4_t test_vreinterpretq_u32_bf16(bfloat16x8_t a) { return vreinterpretq_u32_bf16(a); }
354 // CHECK-LABEL: define dso_local <16 x i8> @test_vreinterpretq_p8_bf16(
355 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
356 // CHECK-NEXT: [[ENTRY:.*:]]
357 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
358 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <16 x i8>
359 // CHECK-NEXT: ret <16 x i8> [[TMP1]]
360 //
361 poly8x16_t test_vreinterpretq_p8_bf16(bfloat16x8_t a) { return vreinterpretq_p8_bf16(a); }
362 // CHECK-LABEL: define dso_local <8 x i16> @test_vreinterpretq_p16_bf16(
363 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
364 // CHECK-NEXT: [[ENTRY:.*:]]
365 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <8 x i16>
366 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
367 //
368 poly16x8_t test_vreinterpretq_p16_bf16(bfloat16x8_t a) { return vreinterpretq_p16_bf16(a); }
369 // CHECK-LABEL: define dso_local <2 x i64> @test_vreinterpretq_u64_bf16(
370 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
371 // CHECK-NEXT: [[ENTRY:.*:]]
372 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <2 x i64>
373 // CHECK-NEXT: ret <2 x i64> [[TMP0]]
374 //
375 uint64x2_t test_vreinterpretq_u64_bf16(bfloat16x8_t a) { return vreinterpretq_u64_bf16(a); }
376 // CHECK-LABEL: define dso_local <2 x i64> @test_vreinterpretq_s64_bf16(
377 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
378 // CHECK-NEXT: [[ENTRY:.*:]]
379 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <2 x i64>
380 // CHECK-NEXT: ret <2 x i64> [[TMP0]]
381 //
382 int64x2_t test_vreinterpretq_s64_bf16(bfloat16x8_t a) { return vreinterpretq_s64_bf16(a); }
383 // CHECK-LABEL: define dso_local <2 x i64> @test_vreinterpretq_p64_bf16(
384 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
385 // CHECK-NEXT: [[ENTRY:.*:]]
386 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <2 x i64>
387 // CHECK-NEXT: ret <2 x i64> [[TMP0]]
388 //
389 poly64x2_t test_vreinterpretq_p64_bf16(bfloat16x8_t a) { return vreinterpretq_p64_bf16(a); }
390 // CHECK-LABEL: define dso_local i128 @test_vreinterpretq_p128_bf16(
391 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
392 // CHECK-NEXT: [[ENTRY:.*:]]
393 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to i128
394 // CHECK-NEXT: ret i128 [[TMP0]]
395 //
396 poly128_t test_vreinterpretq_p128_bf16(bfloat16x8_t a) { return vreinterpretq_p128_bf16(a); }
397 // CHECK-LABEL: define dso_local <1 x double> @test_vreinterpret_f64_bf16(
398 // CHECK-SAME: <4 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
399 // CHECK-NEXT: [[ENTRY:.*:]]
400 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x bfloat> [[A]] to i64
401 // CHECK-NEXT: [[__P0_ADDR_I_SROA_0_0_VEC_INSERT:%.*]] = insertelement <1 x i64> undef, i64 [[TMP0]], i32 0
402 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <1 x i64> [[__P0_ADDR_I_SROA_0_0_VEC_INSERT]] to <1 x double>
403 // CHECK-NEXT: ret <1 x double> [[TMP1]]
404 //
405 float64x1_t test_vreinterpret_f64_bf16(bfloat16x4_t a) { return vreinterpret_f64_bf16(a); }
406 // CHECK-LABEL: define dso_local <2 x double> @test_vreinterpretq_f64_bf16(
407 // CHECK-SAME: <8 x bfloat> noundef [[A:%.*]]) #[[ATTR0]] {
408 // CHECK-NEXT: [[ENTRY:.*:]]
409 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x bfloat> [[A]] to <2 x i64>
410 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[TMP0]] to <2 x double>
411 // CHECK-NEXT: ret <2 x double> [[TMP1]]
412 //
413 float64x2_t test_vreinterpretq_f64_bf16(bfloat16x8_t a) { return vreinterpretq_f64_bf16(a); }