blob: e05ef7d9ab82477832ff00cbd71fde25270c7453 [file] [log] [blame]
Bill Schmidt87982a12014-10-19 20:48:47 +00001; FIXME: FastISel currently returns false if it hits code that uses VSX
Mehdi Amini945a6602015-02-27 18:32:11 +00002; registers and with -fast-isel-abort=1 turned on the test case will then fail.
Bill Schmidt87982a12014-10-19 20:48:47 +00003; When fastisel better supports VSX fix up this test case.
4;
Mehdi Amini945a6602015-02-27 18:32:11 +00005; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
Bill Schmidtd89f6782013-08-26 19:42:51 +00006
Eric Christopher1fb23392015-07-24 01:07:50 +00007define zeroext i1 @rettrue() nounwind {
Samuel Antao61570df2014-09-17 23:25:06 +00008entry:
9; ELF64-LABEL: rettrue
10; ELF64: li 3, 1
11; ELF64: blr
12 ret i1 true
13}
14
Eric Christopher1fb23392015-07-24 01:07:50 +000015define zeroext i1 @retfalse() nounwind {
Samuel Antao61570df2014-09-17 23:25:06 +000016entry:
17; ELF64-LABEL: retfalse
18; ELF64: li 3, 0
19; ELF64: blr
20 ret i1 false
21}
22
Eric Christopher1fb23392015-07-24 01:07:50 +000023define signext i1 @retstrue() nounwind {
Samuel Antao61570df2014-09-17 23:25:06 +000024entry:
25; ELF64-LABEL: retstrue
26; ELF64: li 3, -1
27; ELF64: blr
28 ret i1 true
29}
30
Eric Christopher1fb23392015-07-24 01:07:50 +000031define signext i1 @retsfalse() nounwind {
Samuel Antao61570df2014-09-17 23:25:06 +000032entry:
33; ELF64-LABEL: retsfalse
34; ELF64: li 3, 0
35; ELF64: blr
36 ret i1 false
37}
38
Eric Christopher1fb23392015-07-24 01:07:50 +000039define signext i8 @ret2(i8 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000040entry:
Samuel Antao61570df2014-09-17 23:25:06 +000041; ELF64-LABEL: ret2
Bill Schmidtd89f6782013-08-26 19:42:51 +000042; ELF64: extsb
43; ELF64: blr
44 ret i8 %a
45}
46
Eric Christopher1fb23392015-07-24 01:07:50 +000047define zeroext i8 @ret3(i8 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000048entry:
Samuel Antao61570df2014-09-17 23:25:06 +000049; ELF64-LABEL: ret3
Bill Schmidtd89f6782013-08-26 19:42:51 +000050; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
51; ELF64: blr
52 ret i8 %a
53}
54
Eric Christopher1fb23392015-07-24 01:07:50 +000055define signext i16 @ret4(i16 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000056entry:
Samuel Antao61570df2014-09-17 23:25:06 +000057; ELF64-LABEL: ret4
Bill Schmidtd89f6782013-08-26 19:42:51 +000058; ELF64: extsh
59; ELF64: blr
60 ret i16 %a
61}
62
Eric Christopher1fb23392015-07-24 01:07:50 +000063define zeroext i16 @ret5(i16 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000064entry:
Samuel Antao61570df2014-09-17 23:25:06 +000065; ELF64-LABEL: ret5
Bill Schmidtd89f6782013-08-26 19:42:51 +000066; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
67; ELF64: blr
68 ret i16 %a
69}
70
Eric Christopher1fb23392015-07-24 01:07:50 +000071define i16 @ret6(i16 %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000072entry:
Samuel Antao61570df2014-09-17 23:25:06 +000073; ELF64-LABEL: ret6
Bill Schmidtd89f6782013-08-26 19:42:51 +000074; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
75; ELF64: blr
76 ret i16 %a
77}
78
Eric Christopher1fb23392015-07-24 01:07:50 +000079define signext i32 @ret7(i32 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000080entry:
Samuel Antao61570df2014-09-17 23:25:06 +000081; ELF64-LABEL: ret7
Bill Schmidtd89f6782013-08-26 19:42:51 +000082; ELF64: extsw
83; ELF64: blr
84 ret i32 %a
85}
86
Eric Christopher1fb23392015-07-24 01:07:50 +000087define zeroext i32 @ret8(i32 signext %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000088entry:
Samuel Antao61570df2014-09-17 23:25:06 +000089; ELF64-LABEL: ret8
Bill Schmidtd89f6782013-08-26 19:42:51 +000090; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32
91; ELF64: blr
92 ret i32 %a
93}
94
Eric Christopher1fb23392015-07-24 01:07:50 +000095define i32 @ret9(i32 %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +000096entry:
Samuel Antao61570df2014-09-17 23:25:06 +000097; ELF64-LABEL: ret9
Bill Schmidtd89f6782013-08-26 19:42:51 +000098; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32
99; ELF64: blr
100 ret i32 %a
101}
102
Eric Christopher1fb23392015-07-24 01:07:50 +0000103define i64 @ret10(i64 %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000104entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000105; ELF64-LABEL: ret10
Bill Schmidtd89f6782013-08-26 19:42:51 +0000106; ELF64-NOT: exts
107; ELF64-NOT: rldicl
108; ELF64: blr
109 ret i64 %a
110}
111
Eric Christopher1fb23392015-07-24 01:07:50 +0000112define float @ret11(float %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000113entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000114; ELF64-LABEL: ret11
Bill Schmidtd89f6782013-08-26 19:42:51 +0000115; ELF64: blr
116 ret float %a
117}
118
Eric Christopher1fb23392015-07-24 01:07:50 +0000119define double @ret12(double %a) nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000120entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000121; ELF64-LABEL: ret12
Bill Schmidtd89f6782013-08-26 19:42:51 +0000122; ELF64: blr
123 ret double %a
124}
125
Eric Christopher1fb23392015-07-24 01:07:50 +0000126define i8 @ret13() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000127entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000128; ELF64-LABEL: ret13
Bill Schmidtd89f6782013-08-26 19:42:51 +0000129; ELF64: li
130; ELF64: blr
131 ret i8 15;
132}
133
Eric Christopher1fb23392015-07-24 01:07:50 +0000134define i16 @ret14() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000135entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000136; ELF64-LABEL: ret14
Bill Schmidtd89f6782013-08-26 19:42:51 +0000137; ELF64: li
138; ELF64: blr
139 ret i16 -225;
140}
141
Eric Christopher1fb23392015-07-24 01:07:50 +0000142define i32 @ret15() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000143entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000144; ELF64-LABEL: ret15
Bill Schmidtd89f6782013-08-26 19:42:51 +0000145; ELF64: lis
146; ELF64: ori
147; ELF64: blr
148 ret i32 278135;
149}
150
Eric Christopher1fb23392015-07-24 01:07:50 +0000151define i64 @ret16() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000152entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000153; ELF64-LABEL: ret16
Bill Schmidtd89f6782013-08-26 19:42:51 +0000154; ELF64: li
155; ELF64: sldi
156; ELF64: oris
157; ELF64: ori
158; ELF64: blr
159 ret i64 27813515225;
160}
161
Eric Christopher1fb23392015-07-24 01:07:50 +0000162define float @ret17() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000163entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000164; ELF64-LABEL: ret17
Bill Schmidtd89f6782013-08-26 19:42:51 +0000165; ELF64: addis
166; ELF64: lfs
167; ELF64: blr
168 ret float 2.5;
169}
170
Eric Christopher1fb23392015-07-24 01:07:50 +0000171define double @ret18() nounwind {
Bill Schmidtd89f6782013-08-26 19:42:51 +0000172entry:
Samuel Antao61570df2014-09-17 23:25:06 +0000173; ELF64-LABEL: ret18
Bill Schmidtd89f6782013-08-26 19:42:51 +0000174; ELF64: addis
175; ELF64: lfd
176; ELF64: blr
177 ret double 2.5e-33;
178}
Eric Christopherf0024d12015-07-25 00:48:08 +0000179
180define zeroext i32 @ret19() nounwind {
181entry:
182; ELF64-LABEL: ret19
183; ELF64: li
184; ELF64: oris
185; ELF64: ori
186; ELF64: blr
187 ret i32 -1
188}