• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; FIXME: FastISel currently returns false if it hits code that uses VSX
2; registers and with -fast-isel-abort=1 turned on the test case will then fail.
3; When fastisel better supports VSX fix up this test case.
4;
5; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
6; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc-unknown-linux-gnu -mcpu=e500 -mattr=spe | FileCheck %s --check-prefix=SPE
7define void @t1a(float %a) nounwind {
8entry:
9; ELF64: t1a
10; SPE: t1a
11  %cmp = fcmp oeq float %a, 0.000000e+00
12; ELF64: addis
13; ELF64: lfs
14; ELF64: fcmpu
15; SPE: efscmpeq
16  br i1 %cmp, label %if.then, label %if.end
17
18if.then:                                          ; preds = %entry
19  call void @foo()
20  br label %if.end
21
22if.end:                                           ; preds = %if.then, %entry
23  ret void
24}
25
26declare void @foo()
27
28define void @t1b(float %a) nounwind {
29entry:
30; ELF64: t1b
31; SPE: t1b
32  %cmp = fcmp oeq float %a, -0.000000e+00
33; ELF64: addis
34; ELF64: lfs
35; ELF64: fcmpu
36; SPE: efscmpeq
37  br i1 %cmp, label %if.then, label %if.end
38
39if.then:                                          ; preds = %entry
40  call void @foo()
41  br label %if.end
42
43if.end:                                           ; preds = %if.then, %entry
44  ret void
45}
46
47define void @t2a(double %a) nounwind {
48entry:
49; ELF64: t2a
50; SPE: t2a
51  %cmp = fcmp oeq double %a, 0.000000e+00
52; ELF64: addis
53; ELF64: lfd
54; ELF64: fcmpu
55; SPE: efdcmpeq
56  br i1 %cmp, label %if.then, label %if.end
57
58if.then:                                          ; preds = %entry
59  call void @foo()
60  br label %if.end
61
62if.end:                                           ; preds = %if.then, %entry
63  ret void
64}
65
66define void @t2b(double %a) nounwind {
67entry:
68; ELF64: t2b
69; SPE: t2b
70  %cmp = fcmp oeq double %a, -0.000000e+00
71; ELF64: addis
72; ELF64: lfd
73; ELF64: fcmpu
74; SPE: efdcmpeq
75  br i1 %cmp, label %if.then, label %if.end
76
77if.then:                                          ; preds = %entry
78  call void @foo()
79  br label %if.end
80
81if.end:                                           ; preds = %if.then, %entry
82  ret void
83}
84
85define void @t4(i8 signext %a) nounwind {
86entry:
87; ELF64: t4
88  %cmp = icmp eq i8 %a, -1
89; ELF64: extsb
90; ELF64: cmpwi
91  br i1 %cmp, label %if.then, label %if.end
92
93if.then:                                          ; preds = %entry
94  call void @foo()
95  br label %if.end
96
97if.end:                                           ; preds = %if.then, %entry
98  ret void
99}
100
101define void @t5(i8 zeroext %a) nounwind {
102entry:
103; ELF64: t5
104  %cmp = icmp eq i8 %a, 1
105; ELF64: extsb
106; ELF64: cmpwi
107  br i1 %cmp, label %if.then, label %if.end
108
109if.then:                                          ; preds = %entry
110  call void @foo()
111  br label %if.end
112
113if.end:                                           ; preds = %if.then, %entry
114  ret void
115}
116
117define void @t6(i16 signext %a) nounwind {
118entry:
119; ELF64: t6
120  %cmp = icmp eq i16 %a, -1
121; ELF64: extsh
122; ELF64: cmpwi
123  br i1 %cmp, label %if.then, label %if.end
124
125if.then:                                          ; preds = %entry
126  call void @foo()
127  br label %if.end
128
129if.end:                                           ; preds = %if.then, %entry
130  ret void
131}
132
133define void @t7(i16 zeroext %a) nounwind {
134entry:
135; ELF64: t7
136  %cmp = icmp eq i16 %a, 1
137; ELF64: extsh
138; ELF64: cmpwi
139  br i1 %cmp, label %if.then, label %if.end
140
141if.then:                                          ; preds = %entry
142  call void @foo()
143  br label %if.end
144
145if.end:                                           ; preds = %if.then, %entry
146  ret void
147}
148
149define void @t8(i32 %a) nounwind {
150entry:
151; ELF64: t8
152  %cmp = icmp eq i32 %a, -1
153; ELF64: cmpwi
154  br i1 %cmp, label %if.then, label %if.end
155
156if.then:                                          ; preds = %entry
157  call void @foo()
158  br label %if.end
159
160if.end:                                           ; preds = %if.then, %entry
161  ret void
162}
163
164define void @t9(i32 %a) nounwind {
165entry:
166; ELF64: t9
167  %cmp = icmp eq i32 %a, 1
168; ELF64: cmpwi
169  br i1 %cmp, label %if.then, label %if.end
170
171if.then:                                          ; preds = %entry
172  call void @foo()
173  br label %if.end
174
175if.end:                                           ; preds = %if.then, %entry
176  ret void
177}
178
179define void @t10(i32 %a) nounwind {
180entry:
181; ELF64: t10
182  %cmp = icmp eq i32 %a, 384
183; ELF64: cmpwi
184  br i1 %cmp, label %if.then, label %if.end
185
186if.then:                                          ; preds = %entry
187  call void @foo()
188  br label %if.end
189
190if.end:                                           ; preds = %if.then, %entry
191  ret void
192}
193
194define void @t11(i32 %a) nounwind {
195entry:
196; ELF64: t11
197  %cmp = icmp eq i32 %a, 4096
198; ELF64: cmpwi
199  br i1 %cmp, label %if.then, label %if.end
200
201if.then:                                          ; preds = %entry
202  call void @foo()
203  br label %if.end
204
205if.end:                                           ; preds = %if.then, %entry
206  ret void
207}
208
209define void @t12(i8 %a) nounwind {
210entry:
211; ELF64: t12
212  %cmp = icmp ugt i8 %a, -113
213; ELF64: clrlwi
214; ELF64: cmplwi
215  br i1 %cmp, label %if.then, label %if.end
216
217if.then:                                          ; preds = %entry
218  call void @foo()
219  br label %if.end
220
221if.end:                                           ; preds = %if.then, %entry
222  ret void
223}
224
225define void @t13() nounwind ssp {
226entry:
227; ELF64: t13
228  %cmp = icmp slt i32 -123, -2147483648
229; ELF64: li
230; ELF64: lis
231; ELF64: cmpw
232  br i1 %cmp, label %if.then, label %if.end
233
234if.then:                                          ; preds = %entry
235  ret void
236
237if.end:                                           ; preds = %entry
238  ret void
239}
240
241define void @t14(i64 %a) nounwind {
242entry:
243; ELF64: t14
244  %cmp = icmp eq i64 %a, -1
245; ELF64: cmpdi
246  br i1 %cmp, label %if.then, label %if.end
247
248if.then:                                          ; preds = %entry
249  call void @foo()
250  br label %if.end
251
252if.end:                                           ; preds = %if.then, %entry
253  ret void
254}
255
256define void @t15(i64 %a) nounwind {
257entry:
258; ELF64: t15
259  %cmp = icmp eq i64 %a, 1
260; ELF64: cmpdi
261  br i1 %cmp, label %if.then, label %if.end
262
263if.then:                                          ; preds = %entry
264  call void @foo()
265  br label %if.end
266
267if.end:                                           ; preds = %if.then, %entry
268  ret void
269}
270
271define void @t16(i64 %a) nounwind {
272entry:
273; ELF64: t16
274  %cmp = icmp eq i64 %a, 384
275; ELF64: cmpdi
276  br i1 %cmp, label %if.then, label %if.end
277
278if.then:                                          ; preds = %entry
279  call void @foo()
280  br label %if.end
281
282if.end:                                           ; preds = %if.then, %entry
283  ret void
284}
285
286define void @t17(i64 %a) nounwind {
287entry:
288; ELF64: t17
289  %cmp = icmp eq i64 %a, 32768
290; Extra operand so we don't match on cmpdi.
291; ELF64: cmpd {{[0-9]+}}
292  br i1 %cmp, label %if.then, label %if.end
293
294if.then:                                          ; preds = %entry
295  call void @foo()
296  br label %if.end
297
298if.end:                                           ; preds = %if.then, %entry
299  ret void
300}
301
302