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