blob: 5ed7d9409e3dd1a14272ca52cec72aef7ac8a359 [file] [log] [blame]
Stephen Canon8216d882015-09-22 11:43:17 +00001; RUN: llc < %s -mtriple=arm64 | FileCheck %s
Geoff Berryc573bf7a2015-07-28 15:24:10 +00002
Stephen Canon8216d882015-09-22 11:43:17 +00003; CHECK-LABEL: testmsws:
4; CHECK: fcvtms w0, s0
5; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +00006define i32 @testmsws(float %a) {
7entry:
8 %call = call float @floorf(float %a) nounwind readnone
9 %conv = fptosi float %call to i32
10 ret i32 %conv
11}
12
Stephen Canon8216d882015-09-22 11:43:17 +000013; CHECK-LABEL: testmsxs:
14; CHECK: fcvtms x0, s0
15; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000016define i64 @testmsxs(float %a) {
17entry:
18 %call = call float @floorf(float %a) nounwind readnone
19 %conv = fptosi float %call to i64
20 ret i64 %conv
21}
22
Stephen Canon8216d882015-09-22 11:43:17 +000023; CHECK-LABEL: testmswd:
24; CHECK: fcvtms w0, d0
25; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000026define i32 @testmswd(double %a) {
27entry:
28 %call = call double @floor(double %a) nounwind readnone
29 %conv = fptosi double %call to i32
30 ret i32 %conv
31}
32
Stephen Canon8216d882015-09-22 11:43:17 +000033; CHECK-LABEL: testmsxd:
34; CHECK: fcvtms x0, d0
35; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000036define i64 @testmsxd(double %a) {
37entry:
38 %call = call double @floor(double %a) nounwind readnone
39 %conv = fptosi double %call to i64
40 ret i64 %conv
41}
42
Stephen Canon8216d882015-09-22 11:43:17 +000043; CHECK-LABEL: testmuws:
44; CHECK: fcvtmu w0, s0
45; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000046define i32 @testmuws(float %a) {
47entry:
48 %call = call float @floorf(float %a) nounwind readnone
49 %conv = fptoui float %call to i32
50 ret i32 %conv
51}
52
Stephen Canon8216d882015-09-22 11:43:17 +000053; CHECK-LABEL: testmuxs:
54; CHECK: fcvtmu x0, s0
55; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000056define i64 @testmuxs(float %a) {
57entry:
58 %call = call float @floorf(float %a) nounwind readnone
59 %conv = fptoui float %call to i64
60 ret i64 %conv
61}
62
Stephen Canon8216d882015-09-22 11:43:17 +000063; CHECK-LABEL: testmuwd:
64; CHECK: fcvtmu w0, d0
65; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000066define i32 @testmuwd(double %a) {
67entry:
68 %call = call double @floor(double %a) nounwind readnone
69 %conv = fptoui double %call to i32
70 ret i32 %conv
71}
72
Stephen Canon8216d882015-09-22 11:43:17 +000073; CHECK-LABEL: testmuxd:
74; CHECK: fcvtmu x0, d0
75; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000076define i64 @testmuxd(double %a) {
77entry:
78 %call = call double @floor(double %a) nounwind readnone
79 %conv = fptoui double %call to i64
80 ret i64 %conv
81}
82
Stephen Canon8216d882015-09-22 11:43:17 +000083; CHECK-LABEL: testpsws:
84; CHECK: fcvtps w0, s0
85; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000086define i32 @testpsws(float %a) {
87entry:
88 %call = call float @ceilf(float %a) nounwind readnone
89 %conv = fptosi float %call to i32
90 ret i32 %conv
91}
92
Stephen Canon8216d882015-09-22 11:43:17 +000093; CHECK-LABEL: testpsxs:
94; CHECK: fcvtps x0, s0
95; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +000096define i64 @testpsxs(float %a) {
97entry:
98 %call = call float @ceilf(float %a) nounwind readnone
99 %conv = fptosi float %call to i64
100 ret i64 %conv
101}
102
Stephen Canon8216d882015-09-22 11:43:17 +0000103; CHECK-LABEL: testpswd:
104; CHECK: fcvtps w0, d0
105; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000106define i32 @testpswd(double %a) {
107entry:
108 %call = call double @ceil(double %a) nounwind readnone
109 %conv = fptosi double %call to i32
110 ret i32 %conv
111}
112
Stephen Canon8216d882015-09-22 11:43:17 +0000113; CHECK-LABEL: testpsxd:
114; CHECK: fcvtps x0, d0
115; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000116define i64 @testpsxd(double %a) {
117entry:
118 %call = call double @ceil(double %a) nounwind readnone
119 %conv = fptosi double %call to i64
120 ret i64 %conv
121}
122
Stephen Canon8216d882015-09-22 11:43:17 +0000123; CHECK-LABEL: testpuws:
124; CHECK: fcvtpu w0, s0
125; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000126define i32 @testpuws(float %a) {
127entry:
128 %call = call float @ceilf(float %a) nounwind readnone
129 %conv = fptoui float %call to i32
130 ret i32 %conv
131}
132
Stephen Canon8216d882015-09-22 11:43:17 +0000133; CHECK-LABEL: testpuxs:
134; CHECK: fcvtpu x0, s0
135; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000136define i64 @testpuxs(float %a) {
137entry:
138 %call = call float @ceilf(float %a) nounwind readnone
139 %conv = fptoui float %call to i64
140 ret i64 %conv
141}
142
Stephen Canon8216d882015-09-22 11:43:17 +0000143; CHECK-LABEL: testpuwd:
144; CHECK: fcvtpu w0, d0
145; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000146define i32 @testpuwd(double %a) {
147entry:
148 %call = call double @ceil(double %a) nounwind readnone
149 %conv = fptoui double %call to i32
150 ret i32 %conv
151}
152
Stephen Canon8216d882015-09-22 11:43:17 +0000153; CHECK-LABEL: testpuxd:
154; CHECK: fcvtpu x0, d0
155; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000156define i64 @testpuxd(double %a) {
157entry:
158 %call = call double @ceil(double %a) nounwind readnone
159 %conv = fptoui double %call to i64
160 ret i64 %conv
161}
162
Stephen Canon8216d882015-09-22 11:43:17 +0000163; CHECK-LABEL: testzsws:
164; CHECK: fcvtzs w0, s0
165; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000166define i32 @testzsws(float %a) {
167entry:
168 %call = call float @truncf(float %a) nounwind readnone
169 %conv = fptosi float %call to i32
170 ret i32 %conv
171}
172
Stephen Canon8216d882015-09-22 11:43:17 +0000173; CHECK-LABEL: testzsxs:
174; CHECK: fcvtzs x0, s0
175; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000176define i64 @testzsxs(float %a) {
177entry:
178 %call = call float @truncf(float %a) nounwind readnone
179 %conv = fptosi float %call to i64
180 ret i64 %conv
181}
182
Stephen Canon8216d882015-09-22 11:43:17 +0000183; CHECK-LABEL: testzswd:
184; CHECK: fcvtzs w0, d0
185; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000186define i32 @testzswd(double %a) {
187entry:
188 %call = call double @trunc(double %a) nounwind readnone
189 %conv = fptosi double %call to i32
190 ret i32 %conv
191}
192
Stephen Canon8216d882015-09-22 11:43:17 +0000193; CHECK-LABEL: testzsxd:
194; CHECK: fcvtzs x0, d0
195; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000196define i64 @testzsxd(double %a) {
197entry:
198 %call = call double @trunc(double %a) nounwind readnone
199 %conv = fptosi double %call to i64
200 ret i64 %conv
201}
202
Stephen Canon8216d882015-09-22 11:43:17 +0000203; CHECK-LABEL: testzuws:
204; CHECK: fcvtzu w0, s0
205; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000206define i32 @testzuws(float %a) {
207entry:
208 %call = call float @truncf(float %a) nounwind readnone
209 %conv = fptoui float %call to i32
210 ret i32 %conv
211}
212
Stephen Canon8216d882015-09-22 11:43:17 +0000213; CHECK-LABEL: testzuxs:
214; CHECK: fcvtzu x0, s0
215; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000216define i64 @testzuxs(float %a) {
217entry:
218 %call = call float @truncf(float %a) nounwind readnone
219 %conv = fptoui float %call to i64
220 ret i64 %conv
221}
222
Stephen Canon8216d882015-09-22 11:43:17 +0000223; CHECK-LABEL: testzuwd:
224; CHECK: fcvtzu w0, d0
225; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000226define i32 @testzuwd(double %a) {
227entry:
228 %call = call double @trunc(double %a) nounwind readnone
229 %conv = fptoui double %call to i32
230 ret i32 %conv
231}
232
Stephen Canon8216d882015-09-22 11:43:17 +0000233; CHECK-LABEL: testzuxd:
234; CHECK: fcvtzu x0, d0
235; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000236define i64 @testzuxd(double %a) {
237entry:
238 %call = call double @trunc(double %a) nounwind readnone
239 %conv = fptoui double %call to i64
240 ret i64 %conv
241}
242
Stephen Canon8216d882015-09-22 11:43:17 +0000243; CHECK-LABEL: testasws:
244; CHECK: fcvtas w0, s0
245; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000246define i32 @testasws(float %a) {
247entry:
248 %call = call float @roundf(float %a) nounwind readnone
249 %conv = fptosi float %call to i32
250 ret i32 %conv
251}
252
Stephen Canon8216d882015-09-22 11:43:17 +0000253; CHECK-LABEL: testasxs:
254; CHECK: fcvtas x0, s0
255; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000256define i64 @testasxs(float %a) {
257entry:
258 %call = call float @roundf(float %a) nounwind readnone
259 %conv = fptosi float %call to i64
260 ret i64 %conv
261}
262
Stephen Canon8216d882015-09-22 11:43:17 +0000263; CHECK-LABEL: testaswd:
264; CHECK: fcvtas w0, d0
265; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000266define i32 @testaswd(double %a) {
267entry:
268 %call = call double @round(double %a) nounwind readnone
269 %conv = fptosi double %call to i32
270 ret i32 %conv
271}
272
Stephen Canon8216d882015-09-22 11:43:17 +0000273; CHECK-LABEL: testasxd:
274; CHECK: fcvtas x0, d0
275; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000276define i64 @testasxd(double %a) {
277entry:
278 %call = call double @round(double %a) nounwind readnone
279 %conv = fptosi double %call to i64
280 ret i64 %conv
281}
282
Stephen Canon8216d882015-09-22 11:43:17 +0000283; CHECK-LABEL: testauws:
284; CHECK: fcvtau w0, s0
285; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000286define i32 @testauws(float %a) {
287entry:
288 %call = call float @roundf(float %a) nounwind readnone
289 %conv = fptoui float %call to i32
290 ret i32 %conv
291}
292
Stephen Canon8216d882015-09-22 11:43:17 +0000293; CHECK-LABEL: testauxs:
294; CHECK: fcvtau x0, s0
295; CHECK-NOT: frintx {{s[0-9]+}}, s0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000296define i64 @testauxs(float %a) {
297entry:
298 %call = call float @roundf(float %a) nounwind readnone
299 %conv = fptoui float %call to i64
300 ret i64 %conv
301}
302
Stephen Canon8216d882015-09-22 11:43:17 +0000303; CHECK-LABEL: testauwd:
304; CHECK: fcvtau w0, d0
305; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000306define i32 @testauwd(double %a) {
307entry:
308 %call = call double @round(double %a) nounwind readnone
309 %conv = fptoui double %call to i32
310 ret i32 %conv
311}
312
Stephen Canon8216d882015-09-22 11:43:17 +0000313; CHECK-LABEL: testauxd:
314; CHECK: fcvtau x0, d0
315; CHECK-NOT: frintx {{d[0-9]+}}, d0
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000316define i64 @testauxd(double %a) {
317entry:
318 %call = call double @round(double %a) nounwind readnone
319 %conv = fptoui double %call to i64
320 ret i64 %conv
321}
322
Geoff Berryc573bf7a2015-07-28 15:24:10 +0000323declare float @floorf(float) nounwind readnone
324declare double @floor(double) nounwind readnone
325declare float @ceilf(float) nounwind readnone
326declare double @ceil(double) nounwind readnone
327declare float @truncf(float) nounwind readnone
328declare double @trunc(double) nounwind readnone
329declare float @roundf(float) nounwind readnone
330declare double @round(double) nounwind readnone