1 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64-unknown-unknown < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
4 ; Function Attrs: nounwind
5 define zeroext i8 @_Z6testcff(float %arg) {
7 %arg.addr = alloca float, align 4
8 store float %arg, float* %arg.addr, align 4
9 %0 = load float, float* %arg.addr, align 4
10 %conv = fptoui float %0 to i8
12 ; CHECK-LABEL: @_Z6testcff
13 ; CHECK: xscvdpsxws [[CONVREG01:[0-9]+]], 1
14 ; CHECK: mfvsrwz 3, [[CONVREG01]]
17 ; Function Attrs: nounwind
18 define float @_Z6testfcc(i8 zeroext %arg) {
20 %arg.addr = alloca i8, align 1
21 store i8 %arg, i8* %arg.addr, align 1
22 %0 = load i8, i8* %arg.addr, align 1
23 %conv = uitofp i8 %0 to float
25 ; CHECK-LABEL: @_Z6testfcc
26 ; CHECK: mtvsrwz [[MOVEREG01:[0-9]+]], 3
27 ; CHECK: xscvuxdsp 1, [[MOVEREG01]]
30 ; Function Attrs: nounwind
31 define zeroext i8 @_Z6testcdd(double %arg) {
33 %arg.addr = alloca double, align 8
34 store double %arg, double* %arg.addr, align 8
35 %0 = load double, double* %arg.addr, align 8
36 %conv = fptoui double %0 to i8
38 ; CHECK-LABEL: @_Z6testcdd
39 ; CHECK: xscvdpsxws [[CONVREG02:[0-9]+]], 1
40 ; CHECK: mfvsrwz 3, [[CONVREG02]]
43 ; Function Attrs: nounwind
44 define double @_Z6testdcc(i8 zeroext %arg) {
46 %arg.addr = alloca i8, align 1
47 store i8 %arg, i8* %arg.addr, align 1
48 %0 = load i8, i8* %arg.addr, align 1
49 %conv = uitofp i8 %0 to double
51 ; CHECK-LABEL: @_Z6testdcc
52 ; CHECK: mtvsrwz [[MOVEREG02:[0-9]+]], 3
53 ; CHECK: xscvuxddp 1, [[MOVEREG02]]
56 ; Function Attrs: nounwind
57 define zeroext i8 @_Z7testucff(float %arg) {
59 %arg.addr = alloca float, align 4
60 store float %arg, float* %arg.addr, align 4
61 %0 = load float, float* %arg.addr, align 4
62 %conv = fptoui float %0 to i8
64 ; CHECK-LABEL: @_Z7testucff
65 ; CHECK: xscvdpsxws [[CONVREG03:[0-9]+]], 1
66 ; CHECK: mfvsrwz 3, [[CONVREG03]]
69 ; Function Attrs: nounwind
70 define float @_Z7testfuch(i8 zeroext %arg) {
72 %arg.addr = alloca i8, align 1
73 store i8 %arg, i8* %arg.addr, align 1
74 %0 = load i8, i8* %arg.addr, align 1
75 %conv = uitofp i8 %0 to float
77 ; CHECK-LABEL: @_Z7testfuch
78 ; CHECK: mtvsrwz [[MOVEREG03:[0-9]+]], 3
79 ; CHECK: xscvuxdsp 1, [[MOVEREG03]]
82 ; Function Attrs: nounwind
83 define zeroext i8 @_Z7testucdd(double %arg) {
85 %arg.addr = alloca double, align 8
86 store double %arg, double* %arg.addr, align 8
87 %0 = load double, double* %arg.addr, align 8
88 %conv = fptoui double %0 to i8
90 ; CHECK-LABEL: @_Z7testucdd
91 ; CHECK: xscvdpsxws [[CONVREG04:[0-9]+]], 1
92 ; CHECK: mfvsrwz 3, [[CONVREG04]]
95 ; Function Attrs: nounwind
96 define double @_Z7testduch(i8 zeroext %arg) {
98 %arg.addr = alloca i8, align 1
99 store i8 %arg, i8* %arg.addr, align 1
100 %0 = load i8, i8* %arg.addr, align 1
101 %conv = uitofp i8 %0 to double
103 ; CHECK-LABEL: @_Z7testduch
104 ; CHECK: mtvsrwz [[MOVEREG04:[0-9]+]], 3
105 ; CHECK: xscvuxddp 1, [[MOVEREG04]]
108 ; Function Attrs: nounwind
109 define signext i16 @_Z6testsff(float %arg) {
111 %arg.addr = alloca float, align 4
112 store float %arg, float* %arg.addr, align 4
113 %0 = load float, float* %arg.addr, align 4
114 %conv = fptosi float %0 to i16
116 ; CHECK-LABEL: @_Z6testsff
117 ; CHECK: xscvdpsxws [[CONVREG05:[0-9]+]], 1
118 ; CHECK: mfvsrwz 3, [[CONVREG05]]
121 ; Function Attrs: nounwind
122 define float @_Z6testfss(i16 signext %arg) {
124 %arg.addr = alloca i16, align 2
125 store i16 %arg, i16* %arg.addr, align 2
126 %0 = load i16, i16* %arg.addr, align 2
127 %conv = sitofp i16 %0 to float
129 ; CHECK-LABEL: @_Z6testfss
130 ; CHECK: mtvsrwa [[MOVEREG05:[0-9]+]], 3
131 ; CHECK: xscvsxdsp 1, [[MOVEREG05]]
134 ; Function Attrs: nounwind
135 define signext i16 @_Z6testsdd(double %arg) {
137 %arg.addr = alloca double, align 8
138 store double %arg, double* %arg.addr, align 8
139 %0 = load double, double* %arg.addr, align 8
140 %conv = fptosi double %0 to i16
142 ; CHECK-LABEL: @_Z6testsdd
143 ; CHECK: xscvdpsxws [[CONVREG06:[0-9]+]], 1
144 ; CHECK: mfvsrwz 3, [[CONVREG06]]
147 ; Function Attrs: nounwind
148 define double @_Z6testdss(i16 signext %arg) {
150 %arg.addr = alloca i16, align 2
151 store i16 %arg, i16* %arg.addr, align 2
152 %0 = load i16, i16* %arg.addr, align 2
153 %conv = sitofp i16 %0 to double
155 ; CHECK-LABEL: @_Z6testdss
156 ; CHECK: mtvsrwa [[MOVEREG06:[0-9]+]], 3
157 ; CHECK: xscvsxddp 1, [[MOVEREG06]]
160 ; Function Attrs: nounwind
161 define zeroext i16 @_Z7testusff(float %arg) {
163 %arg.addr = alloca float, align 4
164 store float %arg, float* %arg.addr, align 4
165 %0 = load float, float* %arg.addr, align 4
166 %conv = fptoui float %0 to i16
168 ; CHECK-LABEL: @_Z7testusff
169 ; CHECK: xscvdpsxws [[CONVREG07:[0-9]+]], 1
170 ; CHECK: mfvsrwz 3, [[CONVREG07]]
173 ; Function Attrs: nounwind
174 define float @_Z7testfust(i16 zeroext %arg) {
176 %arg.addr = alloca i16, align 2
177 store i16 %arg, i16* %arg.addr, align 2
178 %0 = load i16, i16* %arg.addr, align 2
179 %conv = uitofp i16 %0 to float
181 ; CHECK-LABEL: @_Z7testfust
182 ; CHECK: mtvsrwz [[MOVEREG07:[0-9]+]], 3
183 ; CHECK: xscvuxdsp 1, [[MOVEREG07]]
186 ; Function Attrs: nounwind
187 define zeroext i16 @_Z7testusdd(double %arg) {
189 %arg.addr = alloca double, align 8
190 store double %arg, double* %arg.addr, align 8
191 %0 = load double, double* %arg.addr, align 8
192 %conv = fptoui double %0 to i16
194 ; CHECK-LABEL: @_Z7testusdd
195 ; CHECK: xscvdpsxws [[CONVREG08:[0-9]+]], 1
196 ; CHECK: mfvsrwz 3, [[CONVREG08]]
199 ; Function Attrs: nounwind
200 define double @_Z7testdust(i16 zeroext %arg) {
202 %arg.addr = alloca i16, align 2
203 store i16 %arg, i16* %arg.addr, align 2
204 %0 = load i16, i16* %arg.addr, align 2
205 %conv = uitofp i16 %0 to double
207 ; CHECK-LABEL: @_Z7testdust
208 ; CHECK: mtvsrwz [[MOVEREG08:[0-9]+]], 3
209 ; CHECK: xscvuxddp 1, [[MOVEREG08]]
212 ; Function Attrs: nounwind
213 define signext i32 @_Z6testiff(float %arg) {
215 %arg.addr = alloca float, align 4
216 store float %arg, float* %arg.addr, align 4
217 %0 = load float, float* %arg.addr, align 4
218 %conv = fptosi float %0 to i32
220 ; CHECK-LABEL: @_Z6testiff
221 ; CHECK: xscvdpsxws [[CONVREG09:[0-9]+]], 1
222 ; CHECK: mfvsrwz 3, [[CONVREG09]]
225 ; Function Attrs: nounwind
226 define float @_Z6testfii(i32 signext %arg) {
228 %arg.addr = alloca i32, align 4
229 store i32 %arg, i32* %arg.addr, align 4
230 %0 = load i32, i32* %arg.addr, align 4
231 %conv = sitofp i32 %0 to float
233 ; CHECK-LABEL: @_Z6testfii
234 ; CHECK: mtvsrwa [[MOVEREG09:[0-9]+]], 3
235 ; CHECK: xscvsxdsp 1, [[MOVEREG09]]
238 ; Function Attrs: nounwind
239 define signext i32 @_Z6testidd(double %arg) {
241 %arg.addr = alloca double, align 8
242 store double %arg, double* %arg.addr, align 8
243 %0 = load double, double* %arg.addr, align 8
244 %conv = fptosi double %0 to i32
246 ; CHECK-LABEL: @_Z6testidd
247 ; CHECK: xscvdpsxws [[CONVREG10:[0-9]+]], 1
248 ; CHECK: mfvsrwz 3, [[CONVREG10]]
251 ; Function Attrs: nounwind
252 define double @_Z6testdii(i32 signext %arg) {
254 %arg.addr = alloca i32, align 4
255 store i32 %arg, i32* %arg.addr, align 4
256 %0 = load i32, i32* %arg.addr, align 4
257 %conv = sitofp i32 %0 to double
259 ; CHECK-LABEL: @_Z6testdii
260 ; CHECK: mtvsrwa [[MOVEREG10:[0-9]+]], 3
261 ; CHECK: xscvsxddp 1, [[MOVEREG10]]
264 ; Function Attrs: nounwind
265 define zeroext i32 @_Z7testuiff(float %arg) {
267 %arg.addr = alloca float, align 4
268 store float %arg, float* %arg.addr, align 4
269 %0 = load float, float* %arg.addr, align 4
270 %conv = fptoui float %0 to i32
272 ; CHECK-LABEL: @_Z7testuiff
273 ; CHECK: xscvdpuxws [[CONVREG11:[0-9]+]], 1
274 ; CHECK: mfvsrwz 3, [[CONVREG11]]
277 ; Function Attrs: nounwind
278 define float @_Z7testfuij(i32 zeroext %arg) {
280 %arg.addr = alloca i32, align 4
281 store i32 %arg, i32* %arg.addr, align 4
282 %0 = load i32, i32* %arg.addr, align 4
283 %conv = uitofp i32 %0 to float
285 ; CHECK-LABEL: @_Z7testfuij
286 ; CHECK: mtvsrwz [[MOVEREG11:[0-9]+]], 3
287 ; CHECK: xscvuxdsp 1, [[MOVEREG11]]
290 ; Function Attrs: nounwind
291 define zeroext i32 @_Z7testuidd(double %arg) {
293 %arg.addr = alloca double, align 8
294 store double %arg, double* %arg.addr, align 8
295 %0 = load double, double* %arg.addr, align 8
296 %conv = fptoui double %0 to i32
298 ; CHECK-LABEL: @_Z7testuidd
299 ; CHECK: xscvdpuxws [[CONVREG12:[0-9]+]], 1
300 ; CHECK: mfvsrwz 3, [[CONVREG12]]
303 ; Function Attrs: nounwind
304 define double @_Z7testduij(i32 zeroext %arg) {
306 %arg.addr = alloca i32, align 4
307 store i32 %arg, i32* %arg.addr, align 4
308 %0 = load i32, i32* %arg.addr, align 4
309 %conv = uitofp i32 %0 to double
311 ; CHECK-LABEL: @_Z7testduij
312 ; CHECK: mtvsrwz [[MOVEREG12:[0-9]+]], 3
313 ; CHECK: xscvuxddp 1, [[MOVEREG12]]
316 ; Function Attrs: nounwind
317 define i64 @_Z7testllff(float %arg) {
319 %arg.addr = alloca float, align 4
320 store float %arg, float* %arg.addr, align 4
321 %0 = load float, float* %arg.addr, align 4
322 %conv = fptosi float %0 to i64
324 ; CHECK-LABEL: @_Z7testllff
325 ; CHECK: xscvdpsxds [[CONVREG13:[0-9]+]], 1
326 ; CHECK: mffprd 3, [[CONVREG13]]
329 ; Function Attrs: nounwind
330 define float @_Z7testfllx(i64 %arg) {
332 %arg.addr = alloca i64, align 8
333 store i64 %arg, i64* %arg.addr, align 8
334 %0 = load i64, i64* %arg.addr, align 8
335 %conv = sitofp i64 %0 to float
337 ; CHECK-LABEL:@_Z7testfllx
338 ; CHECK: mtvsrd [[MOVEREG13:[0-9]+]], 3
339 ; CHECK: xscvsxdsp 1, [[MOVEREG13]]
342 ; Function Attrs: nounwind
343 define i64 @_Z7testlldd(double %arg) {
345 %arg.addr = alloca double, align 8
346 store double %arg, double* %arg.addr, align 8
347 %0 = load double, double* %arg.addr, align 8
348 %conv = fptosi double %0 to i64
350 ; CHECK-LABEL: @_Z7testlldd
351 ; CHECK: xscvdpsxds [[CONVREG14:[0-9]+]], 1
352 ; CHECK: mffprd 3, [[CONVREG14]]
355 ; Function Attrs: nounwind
356 define double @_Z7testdllx(i64 %arg) {
358 %arg.addr = alloca i64, align 8
359 store i64 %arg, i64* %arg.addr, align 8
360 %0 = load i64, i64* %arg.addr, align 8
361 %conv = sitofp i64 %0 to double
363 ; CHECK-LABEL: @_Z7testdllx
364 ; CHECK: mtvsrd [[MOVEREG14:[0-9]+]], 3
365 ; CHECK: xscvsxddp 1, [[MOVEREG14]]
368 ; Function Attrs: nounwind
369 define i64 @_Z8testullff(float %arg) {
371 %arg.addr = alloca float, align 4
372 store float %arg, float* %arg.addr, align 4
373 %0 = load float, float* %arg.addr, align 4
374 %conv = fptoui float %0 to i64
376 ; CHECK-LABEL: @_Z8testullff
377 ; CHECK: xscvdpuxds [[CONVREG15:[0-9]+]], 1
378 ; CHECK: mffprd 3, [[CONVREG15]]
381 ; Function Attrs: nounwind
382 define float @_Z8testfully(i64 %arg) {
384 %arg.addr = alloca i64, align 8
385 store i64 %arg, i64* %arg.addr, align 8
386 %0 = load i64, i64* %arg.addr, align 8
387 %conv = uitofp i64 %0 to float
389 ; CHECK-LABEL: @_Z8testfully
390 ; CHECK: mtvsrd [[MOVEREG15:[0-9]+]], 3
391 ; CHECK: xscvuxdsp 1, [[MOVEREG15]]
394 ; Function Attrs: nounwind
395 define i64 @_Z8testulldd(double %arg) {
397 %arg.addr = alloca double, align 8
398 store double %arg, double* %arg.addr, align 8
399 %0 = load double, double* %arg.addr, align 8
400 %conv = fptoui double %0 to i64
402 ; CHECK-LABEL: @_Z8testulldd
403 ; CHECK: xscvdpuxds [[CONVREG16:[0-9]+]], 1
404 ; CHECK: mffprd 3, [[CONVREG16]]
407 ; Function Attrs: nounwind
408 define double @_Z8testdully(i64 %arg) {
410 %arg.addr = alloca i64, align 8
411 store i64 %arg, i64* %arg.addr, align 8
412 %0 = load i64, i64* %arg.addr, align 8
413 %conv = uitofp i64 %0 to double
415 ; CHECK-LABEL: @_Z8testdully
416 ; CHECK: mtvsrd [[MOVEREG16:[0-9]+]], 3
417 ; CHECK: xscvuxddp 1, [[MOVEREG16]]