1 ; RUN: llc < %s -mtriple=arm64 | FileCheck %s
3 ; CHECK-LABEL: testmsws:
5 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
6 define i32 @testmsws(float %a) {
8 %call = call float @floorf(float %a) nounwind readnone
9 %conv = fptosi float %call to i32
13 ; CHECK-LABEL: testmsxs:
14 ; CHECK: fcvtms x0, s0
15 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
16 define i64 @testmsxs(float %a) {
18 %call = call float @floorf(float %a) nounwind readnone
19 %conv = fptosi float %call to i64
23 ; CHECK-LABEL: testmswd:
24 ; CHECK: fcvtms w0, d0
25 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
26 define i32 @testmswd(double %a) {
28 %call = call double @floor(double %a) nounwind readnone
29 %conv = fptosi double %call to i32
33 ; CHECK-LABEL: testmsxd:
34 ; CHECK: fcvtms x0, d0
35 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
36 define i64 @testmsxd(double %a) {
38 %call = call double @floor(double %a) nounwind readnone
39 %conv = fptosi double %call to i64
43 ; CHECK-LABEL: testmuws:
44 ; CHECK: fcvtmu w0, s0
45 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
46 define i32 @testmuws(float %a) {
48 %call = call float @floorf(float %a) nounwind readnone
49 %conv = fptoui float %call to i32
53 ; CHECK-LABEL: testmuxs:
54 ; CHECK: fcvtmu x0, s0
55 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
56 define i64 @testmuxs(float %a) {
58 %call = call float @floorf(float %a) nounwind readnone
59 %conv = fptoui float %call to i64
63 ; CHECK-LABEL: testmuwd:
64 ; CHECK: fcvtmu w0, d0
65 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
66 define i32 @testmuwd(double %a) {
68 %call = call double @floor(double %a) nounwind readnone
69 %conv = fptoui double %call to i32
73 ; CHECK-LABEL: testmuxd:
74 ; CHECK: fcvtmu x0, d0
75 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
76 define i64 @testmuxd(double %a) {
78 %call = call double @floor(double %a) nounwind readnone
79 %conv = fptoui double %call to i64
83 ; CHECK-LABEL: testpsws:
84 ; CHECK: fcvtps w0, s0
85 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
86 define i32 @testpsws(float %a) {
88 %call = call float @ceilf(float %a) nounwind readnone
89 %conv = fptosi float %call to i32
93 ; CHECK-LABEL: testpsxs:
94 ; CHECK: fcvtps x0, s0
95 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
96 define i64 @testpsxs(float %a) {
98 %call = call float @ceilf(float %a) nounwind readnone
99 %conv = fptosi float %call to i64
103 ; CHECK-LABEL: testpswd:
104 ; CHECK: fcvtps w0, d0
105 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
106 define i32 @testpswd(double %a) {
108 %call = call double @ceil(double %a) nounwind readnone
109 %conv = fptosi double %call to i32
113 ; CHECK-LABEL: testpsxd:
114 ; CHECK: fcvtps x0, d0
115 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
116 define i64 @testpsxd(double %a) {
118 %call = call double @ceil(double %a) nounwind readnone
119 %conv = fptosi double %call to i64
123 ; CHECK-LABEL: testpuws:
124 ; CHECK: fcvtpu w0, s0
125 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
126 define i32 @testpuws(float %a) {
128 %call = call float @ceilf(float %a) nounwind readnone
129 %conv = fptoui float %call to i32
133 ; CHECK-LABEL: testpuxs:
134 ; CHECK: fcvtpu x0, s0
135 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
136 define i64 @testpuxs(float %a) {
138 %call = call float @ceilf(float %a) nounwind readnone
139 %conv = fptoui float %call to i64
143 ; CHECK-LABEL: testpuwd:
144 ; CHECK: fcvtpu w0, d0
145 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
146 define i32 @testpuwd(double %a) {
148 %call = call double @ceil(double %a) nounwind readnone
149 %conv = fptoui double %call to i32
153 ; CHECK-LABEL: testpuxd:
154 ; CHECK: fcvtpu x0, d0
155 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
156 define i64 @testpuxd(double %a) {
158 %call = call double @ceil(double %a) nounwind readnone
159 %conv = fptoui double %call to i64
163 ; CHECK-LABEL: testzsws:
164 ; CHECK: fcvtzs w0, s0
165 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
166 define i32 @testzsws(float %a) {
168 %call = call float @truncf(float %a) nounwind readnone
169 %conv = fptosi float %call to i32
173 ; CHECK-LABEL: testzsxs:
174 ; CHECK: fcvtzs x0, s0
175 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
176 define i64 @testzsxs(float %a) {
178 %call = call float @truncf(float %a) nounwind readnone
179 %conv = fptosi float %call to i64
183 ; CHECK-LABEL: testzswd:
184 ; CHECK: fcvtzs w0, d0
185 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
186 define i32 @testzswd(double %a) {
188 %call = call double @trunc(double %a) nounwind readnone
189 %conv = fptosi double %call to i32
193 ; CHECK-LABEL: testzsxd:
194 ; CHECK: fcvtzs x0, d0
195 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
196 define i64 @testzsxd(double %a) {
198 %call = call double @trunc(double %a) nounwind readnone
199 %conv = fptosi double %call to i64
203 ; CHECK-LABEL: testzuws:
204 ; CHECK: fcvtzu w0, s0
205 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
206 define i32 @testzuws(float %a) {
208 %call = call float @truncf(float %a) nounwind readnone
209 %conv = fptoui float %call to i32
213 ; CHECK-LABEL: testzuxs:
214 ; CHECK: fcvtzu x0, s0
215 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
216 define i64 @testzuxs(float %a) {
218 %call = call float @truncf(float %a) nounwind readnone
219 %conv = fptoui float %call to i64
223 ; CHECK-LABEL: testzuwd:
224 ; CHECK: fcvtzu w0, d0
225 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
226 define i32 @testzuwd(double %a) {
228 %call = call double @trunc(double %a) nounwind readnone
229 %conv = fptoui double %call to i32
233 ; CHECK-LABEL: testzuxd:
234 ; CHECK: fcvtzu x0, d0
235 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
236 define i64 @testzuxd(double %a) {
238 %call = call double @trunc(double %a) nounwind readnone
239 %conv = fptoui double %call to i64
243 ; CHECK-LABEL: testasws:
244 ; CHECK: fcvtas w0, s0
245 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
246 define i32 @testasws(float %a) {
248 %call = call float @roundf(float %a) nounwind readnone
249 %conv = fptosi float %call to i32
253 ; CHECK-LABEL: testasxs:
254 ; CHECK: fcvtas x0, s0
255 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
256 define i64 @testasxs(float %a) {
258 %call = call float @roundf(float %a) nounwind readnone
259 %conv = fptosi float %call to i64
263 ; CHECK-LABEL: testaswd:
264 ; CHECK: fcvtas w0, d0
265 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
266 define i32 @testaswd(double %a) {
268 %call = call double @round(double %a) nounwind readnone
269 %conv = fptosi double %call to i32
273 ; CHECK-LABEL: testasxd:
274 ; CHECK: fcvtas x0, d0
275 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
276 define i64 @testasxd(double %a) {
278 %call = call double @round(double %a) nounwind readnone
279 %conv = fptosi double %call to i64
283 ; CHECK-LABEL: testauws:
284 ; CHECK: fcvtau w0, s0
285 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
286 define i32 @testauws(float %a) {
288 %call = call float @roundf(float %a) nounwind readnone
289 %conv = fptoui float %call to i32
293 ; CHECK-LABEL: testauxs:
294 ; CHECK: fcvtau x0, s0
295 ; CHECK-NOT: frintx {{s[0-9]+}}, s0
296 define i64 @testauxs(float %a) {
298 %call = call float @roundf(float %a) nounwind readnone
299 %conv = fptoui float %call to i64
303 ; CHECK-LABEL: testauwd:
304 ; CHECK: fcvtau w0, d0
305 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
306 define i32 @testauwd(double %a) {
308 %call = call double @round(double %a) nounwind readnone
309 %conv = fptoui double %call to i32
313 ; CHECK-LABEL: testauxd:
314 ; CHECK: fcvtau x0, d0
315 ; CHECK-NOT: frintx {{d[0-9]+}}, d0
316 define i64 @testauxd(double %a) {
318 %call = call double @round(double %a) nounwind readnone
319 %conv = fptoui double %call to i64
323 declare float @floorf(float) nounwind readnone
324 declare double @floor(double) nounwind readnone
325 declare float @ceilf(float) nounwind readnone
326 declare double @ceil(double) nounwind readnone
327 declare float @truncf(float) nounwind readnone
328 declare double @trunc(double) nounwind readnone
329 declare float @roundf(float) nounwind readnone
330 declare double @round(double) nounwind readnone