Debian Codegraph @

clang/test/CodeGen/arm-neon-directed-rounding.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 \
3 // RUN: -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \
4 // RUN: opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=CHECK,CHECK-A32 %s
5 // RUN: %clang_cc1 -triple arm64-linux-gnueabihf -target-feature +neon \
6 // RUN: -ffreestanding -disable-O0-optnone -emit-llvm %s -o - | \
7 // RUN: opt -S -passes=mem2reg,sroa | FileCheck -check-prefixes=CHECK,CHECK-A64 %s
8
9 // REQUIRES: aarch64-registered-target || arm-registered-target
10
11 #include <arm_neon.h>
12
13 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrnda_f32(
14 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
15 // CHECK-A32-NEXT: [[ENTRY:.*:]]
16 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
17 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
18 // CHECK-A32-NEXT: [[VRNDA_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
19 // CHECK-A32-NEXT: [[VRNDA_V1_I:%.*]] = call <2 x float> @llvm.round.v2f32(<2 x float> [[VRNDA_V_I]])
20 // CHECK-A32-NEXT: [[VRNDA_V2_I:%.*]] = bitcast <2 x float> [[VRNDA_V1_I]] to <8 x i8>
21 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRNDA_V2_I]] to <2 x i32>
22 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
23 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
24 //
25 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrnda_f32(
26 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
27 // CHECK-A64-NEXT: [[ENTRY:.*:]]
28 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
29 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
30 // CHECK-A64-NEXT: [[VRNDA_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
31 // CHECK-A64-NEXT: [[VRNDA1_I:%.*]] = call <2 x float> @llvm.round.v2f32(<2 x float> [[VRNDA_I]])
32 // CHECK-A64-NEXT: ret <2 x float> [[VRNDA1_I]]
33 //
34 float32x2_t test_vrnda_f32(float32x2_t a) {
35 return vrnda_f32(a);
36 }
37
38 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndaq_f32(
39 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
40 // CHECK-A32-NEXT: [[ENTRY:.*:]]
41 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
42 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
43 // CHECK-A32-NEXT: [[VRNDAQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
44 // CHECK-A32-NEXT: [[VRNDAQ_V1_I:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[VRNDAQ_V_I]])
45 // CHECK-A32-NEXT: [[VRNDAQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDAQ_V1_I]] to <16 x i8>
46 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDAQ_V2_I]] to <4 x i32>
47 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
48 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
49 //
50 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndaq_f32(
51 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
52 // CHECK-A64-NEXT: [[ENTRY:.*:]]
53 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
54 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
55 // CHECK-A64-NEXT: [[VRNDA_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
56 // CHECK-A64-NEXT: [[VRNDA1_I:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[VRNDA_I]])
57 // CHECK-A64-NEXT: ret <4 x float> [[VRNDA1_I]]
58 //
59 float32x4_t test_vrndaq_f32(float32x4_t a) {
60 return vrndaq_f32(a);
61 }
62
63 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrndm_f32(
64 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
65 // CHECK-A32-NEXT: [[ENTRY:.*:]]
66 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
67 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
68 // CHECK-A32-NEXT: [[VRNDM_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
69 // CHECK-A32-NEXT: [[VRNDM_V1_I:%.*]] = call <2 x float> @llvm.floor.v2f32(<2 x float> [[VRNDM_V_I]])
70 // CHECK-A32-NEXT: [[VRNDM_V2_I:%.*]] = bitcast <2 x float> [[VRNDM_V1_I]] to <8 x i8>
71 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRNDM_V2_I]] to <2 x i32>
72 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
73 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
74 //
75 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrndm_f32(
76 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
77 // CHECK-A64-NEXT: [[ENTRY:.*:]]
78 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
79 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
80 // CHECK-A64-NEXT: [[VRNDM_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
81 // CHECK-A64-NEXT: [[VRNDM1_I:%.*]] = call <2 x float> @llvm.floor.v2f32(<2 x float> [[VRNDM_I]])
82 // CHECK-A64-NEXT: ret <2 x float> [[VRNDM1_I]]
83 //
84 float32x2_t test_vrndm_f32(float32x2_t a) {
85 return vrndm_f32(a);
86 }
87
88 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndmq_f32(
89 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
90 // CHECK-A32-NEXT: [[ENTRY:.*:]]
91 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
92 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
93 // CHECK-A32-NEXT: [[VRNDMQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
94 // CHECK-A32-NEXT: [[VRNDMQ_V1_I:%.*]] = call <4 x float> @llvm.floor.v4f32(<4 x float> [[VRNDMQ_V_I]])
95 // CHECK-A32-NEXT: [[VRNDMQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDMQ_V1_I]] to <16 x i8>
96 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDMQ_V2_I]] to <4 x i32>
97 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
98 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
99 //
100 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndmq_f32(
101 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
102 // CHECK-A64-NEXT: [[ENTRY:.*:]]
103 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
104 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
105 // CHECK-A64-NEXT: [[VRNDM_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
106 // CHECK-A64-NEXT: [[VRNDM1_I:%.*]] = call <4 x float> @llvm.floor.v4f32(<4 x float> [[VRNDM_I]])
107 // CHECK-A64-NEXT: ret <4 x float> [[VRNDM1_I]]
108 //
109 float32x4_t test_vrndmq_f32(float32x4_t a) {
110 return vrndmq_f32(a);
111 }
112
113 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrndn_f32(
114 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
115 // CHECK-A32-NEXT: [[ENTRY:.*:]]
116 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
117 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
118 // CHECK-A32-NEXT: [[VRNDN_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
119 // CHECK-A32-NEXT: [[VRNDN_V1_I:%.*]] = call <2 x float> @llvm.roundeven.v2f32(<2 x float> [[VRNDN_V_I]])
120 // CHECK-A32-NEXT: [[VRNDN_V2_I:%.*]] = bitcast <2 x float> [[VRNDN_V1_I]] to <8 x i8>
121 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRNDN_V2_I]] to <2 x i32>
122 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
123 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
124 //
125 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrndn_f32(
126 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
127 // CHECK-A64-NEXT: [[ENTRY:.*:]]
128 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
129 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
130 // CHECK-A64-NEXT: [[VRNDN_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
131 // CHECK-A64-NEXT: [[VRNDN1_I:%.*]] = call <2 x float> @llvm.roundeven.v2f32(<2 x float> [[VRNDN_I]])
132 // CHECK-A64-NEXT: ret <2 x float> [[VRNDN1_I]]
133 //
134 float32x2_t test_vrndn_f32(float32x2_t a) {
135 return vrndn_f32(a);
136 }
137
138 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndnq_f32(
139 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
140 // CHECK-A32-NEXT: [[ENTRY:.*:]]
141 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
142 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
143 // CHECK-A32-NEXT: [[VRNDNQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
144 // CHECK-A32-NEXT: [[VRNDNQ_V1_I:%.*]] = call <4 x float> @llvm.roundeven.v4f32(<4 x float> [[VRNDNQ_V_I]])
145 // CHECK-A32-NEXT: [[VRNDNQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDNQ_V1_I]] to <16 x i8>
146 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDNQ_V2_I]] to <4 x i32>
147 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
148 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
149 //
150 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndnq_f32(
151 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
152 // CHECK-A64-NEXT: [[ENTRY:.*:]]
153 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
154 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
155 // CHECK-A64-NEXT: [[VRNDN_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
156 // CHECK-A64-NEXT: [[VRNDN1_I:%.*]] = call <4 x float> @llvm.roundeven.v4f32(<4 x float> [[VRNDN_I]])
157 // CHECK-A64-NEXT: ret <4 x float> [[VRNDN1_I]]
158 //
159 float32x4_t test_vrndnq_f32(float32x4_t a) {
160 return vrndnq_f32(a);
161 }
162
163 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrndp_f32(
164 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
165 // CHECK-A32-NEXT: [[ENTRY:.*:]]
166 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
167 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
168 // CHECK-A32-NEXT: [[VRNDP_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
169 // CHECK-A32-NEXT: [[VRNDP_V1_I:%.*]] = call <2 x float> @llvm.ceil.v2f32(<2 x float> [[VRNDP_V_I]])
170 // CHECK-A32-NEXT: [[VRNDP_V2_I:%.*]] = bitcast <2 x float> [[VRNDP_V1_I]] to <8 x i8>
171 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRNDP_V2_I]] to <2 x i32>
172 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
173 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
174 //
175 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrndp_f32(
176 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
177 // CHECK-A64-NEXT: [[ENTRY:.*:]]
178 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
179 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
180 // CHECK-A64-NEXT: [[VRNDP_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
181 // CHECK-A64-NEXT: [[VRNDP1_I:%.*]] = call <2 x float> @llvm.ceil.v2f32(<2 x float> [[VRNDP_I]])
182 // CHECK-A64-NEXT: ret <2 x float> [[VRNDP1_I]]
183 //
184 float32x2_t test_vrndp_f32(float32x2_t a) {
185 return vrndp_f32(a);
186 }
187
188 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndpq_f32(
189 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
190 // CHECK-A32-NEXT: [[ENTRY:.*:]]
191 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
192 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
193 // CHECK-A32-NEXT: [[VRNDPQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
194 // CHECK-A32-NEXT: [[VRNDPQ_V1_I:%.*]] = call <4 x float> @llvm.ceil.v4f32(<4 x float> [[VRNDPQ_V_I]])
195 // CHECK-A32-NEXT: [[VRNDPQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDPQ_V1_I]] to <16 x i8>
196 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDPQ_V2_I]] to <4 x i32>
197 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
198 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
199 //
200 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndpq_f32(
201 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
202 // CHECK-A64-NEXT: [[ENTRY:.*:]]
203 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
204 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
205 // CHECK-A64-NEXT: [[VRNDP_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
206 // CHECK-A64-NEXT: [[VRNDP1_I:%.*]] = call <4 x float> @llvm.ceil.v4f32(<4 x float> [[VRNDP_I]])
207 // CHECK-A64-NEXT: ret <4 x float> [[VRNDP1_I]]
208 //
209 float32x4_t test_vrndpq_f32(float32x4_t a) {
210 return vrndpq_f32(a);
211 }
212
213 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrndx_f32(
214 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
215 // CHECK-A32-NEXT: [[ENTRY:.*:]]
216 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
217 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
218 // CHECK-A32-NEXT: [[VRNDX_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
219 // CHECK-A32-NEXT: [[VRNDX_V1_I:%.*]] = call <2 x float> @llvm.rint.v2f32(<2 x float> [[VRNDX_V_I]])
220 // CHECK-A32-NEXT: [[VRNDX_V2_I:%.*]] = bitcast <2 x float> [[VRNDX_V1_I]] to <8 x i8>
221 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRNDX_V2_I]] to <2 x i32>
222 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
223 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
224 //
225 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrndx_f32(
226 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
227 // CHECK-A64-NEXT: [[ENTRY:.*:]]
228 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
229 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
230 // CHECK-A64-NEXT: [[VRNDX_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
231 // CHECK-A64-NEXT: [[VRNDX1_I:%.*]] = call <2 x float> @llvm.rint.v2f32(<2 x float> [[VRNDX_I]])
232 // CHECK-A64-NEXT: ret <2 x float> [[VRNDX1_I]]
233 //
234 float32x2_t test_vrndx_f32(float32x2_t a) {
235 return vrndx_f32(a);
236 }
237
238 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndxq_f32(
239 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
240 // CHECK-A32-NEXT: [[ENTRY:.*:]]
241 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
242 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
243 // CHECK-A32-NEXT: [[VRNDXQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
244 // CHECK-A32-NEXT: [[VRNDXQ_V1_I:%.*]] = call <4 x float> @llvm.rint.v4f32(<4 x float> [[VRNDXQ_V_I]])
245 // CHECK-A32-NEXT: [[VRNDXQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDXQ_V1_I]] to <16 x i8>
246 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDXQ_V2_I]] to <4 x i32>
247 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
248 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
249 //
250 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndxq_f32(
251 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
252 // CHECK-A64-NEXT: [[ENTRY:.*:]]
253 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
254 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
255 // CHECK-A64-NEXT: [[VRNDX_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
256 // CHECK-A64-NEXT: [[VRNDX1_I:%.*]] = call <4 x float> @llvm.rint.v4f32(<4 x float> [[VRNDX_I]])
257 // CHECK-A64-NEXT: ret <4 x float> [[VRNDX1_I]]
258 //
259 float32x4_t test_vrndxq_f32(float32x4_t a) {
260 return vrndxq_f32(a);
261 }
262
263 // CHECK-A32-LABEL: define dso_local <2 x float> @test_vrnd_f32(
264 // CHECK-A32-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
265 // CHECK-A32-NEXT: [[ENTRY:.*:]]
266 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
267 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
268 // CHECK-A32-NEXT: [[VRND_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
269 // CHECK-A32-NEXT: [[VRND_V1_I:%.*]] = call <2 x float> @llvm.trunc.v2f32(<2 x float> [[VRND_V_I]])
270 // CHECK-A32-NEXT: [[VRND_V2_I:%.*]] = bitcast <2 x float> [[VRND_V1_I]] to <8 x i8>
271 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <8 x i8> [[VRND_V2_I]] to <2 x i32>
272 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <2 x i32> [[TMP2]] to <2 x float>
273 // CHECK-A32-NEXT: ret <2 x float> [[TMP3]]
274 //
275 // CHECK-A64-LABEL: define dso_local <2 x float> @test_vrnd_f32(
276 // CHECK-A64-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
277 // CHECK-A64-NEXT: [[ENTRY:.*:]]
278 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
279 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
280 // CHECK-A64-NEXT: [[VRNDZ_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
281 // CHECK-A64-NEXT: [[VRNDZ1_I:%.*]] = call <2 x float> @llvm.trunc.v2f32(<2 x float> [[VRNDZ_I]])
282 // CHECK-A64-NEXT: ret <2 x float> [[VRNDZ1_I]]
283 //
284 float32x2_t test_vrnd_f32(float32x2_t a) {
285 return vrnd_f32(a);
286 }
287
288 // CHECK-A32-LABEL: define dso_local <4 x float> @test_vrndq_f32(
289 // CHECK-A32-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
290 // CHECK-A32-NEXT: [[ENTRY:.*:]]
291 // CHECK-A32-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
292 // CHECK-A32-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
293 // CHECK-A32-NEXT: [[VRNDQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
294 // CHECK-A32-NEXT: [[VRNDQ_V1_I:%.*]] = call <4 x float> @llvm.trunc.v4f32(<4 x float> [[VRNDQ_V_I]])
295 // CHECK-A32-NEXT: [[VRNDQ_V2_I:%.*]] = bitcast <4 x float> [[VRNDQ_V1_I]] to <16 x i8>
296 // CHECK-A32-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VRNDQ_V2_I]] to <4 x i32>
297 // CHECK-A32-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
298 // CHECK-A32-NEXT: ret <4 x float> [[TMP3]]
299 //
300 // CHECK-A64-LABEL: define dso_local <4 x float> @test_vrndq_f32(
301 // CHECK-A64-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
302 // CHECK-A64-NEXT: [[ENTRY:.*:]]
303 // CHECK-A64-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
304 // CHECK-A64-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
305 // CHECK-A64-NEXT: [[VRNDZ_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
306 // CHECK-A64-NEXT: [[VRNDZ1_I:%.*]] = call <4 x float> @llvm.trunc.v4f32(<4 x float> [[VRNDZ_I]])
307 // CHECK-A64-NEXT: ret <4 x float> [[VRNDZ1_I]]
308 //
309 float32x4_t test_vrndq_f32(float32x4_t a) {
310 return vrndq_f32(a);
311 }
312
313 // CHECK-LABEL: define dso_local float @test_vrndns_f32(
314 // CHECK-SAME: float noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
315 // CHECK-NEXT: [[ENTRY:.*:]]
316 // CHECK-NEXT: [[VRNDN_I:%.*]] = call float @llvm.roundeven.f32(float [[A]])
317 // CHECK-NEXT: ret float [[VRNDN_I]]
318 //
319 float32_t test_vrndns_f32(float32_t a) {
320 return vrndns_f32(a);
321 }
322
323 // CHECK-LABEL: define dso_local <2 x float> @test_vrndi_f32(
324 // CHECK-SAME: <2 x float> noundef [[A:%.*]]) #[[ATTR0]] {
325 // CHECK-NEXT: [[ENTRY:.*:]]
326 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x float> [[A]] to <2 x i32>
327 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
328 // CHECK-NEXT: [[VRNDI_V_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x float>
329 // CHECK-NEXT: [[VRNDI_V1_I:%.*]] = call <2 x float> @llvm.nearbyint.v2f32(<2 x float> [[VRNDI_V_I]])
330 // CHECK-NEXT: ret <2 x float> [[VRNDI_V1_I]]
331 //
332 float32x2_t test_vrndi_f32(float32x2_t a) {
333 return vrndi_f32(a);
334 }
335
336 // CHECK-LABEL: define dso_local <4 x float> @test_vrndiq_f32(
337 // CHECK-SAME: <4 x float> noundef [[A:%.*]]) #[[ATTR0]] {
338 // CHECK-NEXT: [[ENTRY:.*:]]
339 // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
340 // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>
341 // CHECK-NEXT: [[VRNDIQ_V_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x float>
342 // CHECK-NEXT: [[VRNDIQ_V1_I:%.*]] = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[VRNDIQ_V_I]])
343 // CHECK-NEXT: ret <4 x float> [[VRNDIQ_V1_I]]
344 //
345 float32x4_t test_vrndiq_f32(float32x4_t a) {
346 return vrndiq_f32(a);
347 }