1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-- < %s -pre-RA-sched=list-ilp | FileCheck %s --check-prefix=ILP
3 ; RUN: llc -mtriple=x86_64-- < %s -pre-RA-sched=list-hybrid | FileCheck %s --check-prefix=HYBRID
4 ; RUN: llc -mtriple=x86_64-- < %s -pre-RA-sched=list-burr | FileCheck %s --check-prefix=BURR
5 ; RUN: llc -mtriple=x86_64-- < %s -pre-RA-sched=source | FileCheck %s --check-prefix=SRC
6 ; FIXME: Fix machine verifier issues and remove -verify-machineinstrs=0. PR39452.
7 ; RUN: llc -mtriple=x86_64-- < %s -pre-RA-sched=linearize -verify-machineinstrs=0 | FileCheck %s --check-prefix=LIN
9 ; PR22304 https://llvm.org/bugs/show_bug.cgi?id=22304
10 ; Tests checking backtracking in source scheduler. llc used to crash on them.
12 define i256 @test1(i256 %a) nounwind {
15 ; ILP-NEXT: movq %rdi, %rax
16 ; ILP-NEXT: leal (%rsi,%rsi), %ecx
17 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
18 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
19 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
20 ; ILP-NEXT: movq $1, -{{[0-9]+}}(%rsp)
21 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
22 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
23 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
24 ; ILP-NEXT: movq $0, -{{[0-9]+}}(%rsp)
25 ; ILP-NEXT: addb $3, %cl
26 ; ILP-NEXT: movl %ecx, %edx
27 ; ILP-NEXT: shrb $3, %dl
28 ; ILP-NEXT: andb $7, %cl
30 ; ILP-NEXT: movsbq %dl, %rdx
31 ; ILP-NEXT: movq -16(%rsp,%rdx), %rsi
32 ; ILP-NEXT: movq -8(%rsp,%rdx), %rdi
33 ; ILP-NEXT: shldq %cl, %rsi, %rdi
34 ; ILP-NEXT: movq -32(%rsp,%rdx), %r8
35 ; ILP-NEXT: movq -24(%rsp,%rdx), %rdx
36 ; ILP-NEXT: movq %r8, %r9
37 ; ILP-NEXT: shlq %cl, %r9
38 ; ILP-NEXT: movq %rdx, %r10
39 ; ILP-NEXT: shldq %cl, %r8, %r10
40 ; ILP-NEXT: movq %rdi, 24(%rax)
41 ; ILP-NEXT: movq %r10, 8(%rax)
42 ; ILP-NEXT: movq %r9, (%rax)
43 ; ILP-NEXT: shlq %cl, %rsi
46 ; ILP-NEXT: # kill: def $cl killed $cl killed $ecx
47 ; ILP-NEXT: shrq %cl, %rdx
48 ; ILP-NEXT: orq %rsi, %rdx
49 ; ILP-NEXT: movq %rdx, 16(%rax)
52 ; HYBRID-LABEL: test1:
54 ; HYBRID-NEXT: movq %rdi, %rax
55 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
56 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
57 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
58 ; HYBRID-NEXT: movq $1, -{{[0-9]+}}(%rsp)
59 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
60 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
61 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
62 ; HYBRID-NEXT: movq $0, -{{[0-9]+}}(%rsp)
63 ; HYBRID-NEXT: addl %esi, %esi
64 ; HYBRID-NEXT: addb $3, %sil
65 ; HYBRID-NEXT: movl %esi, %ecx
66 ; HYBRID-NEXT: andb $7, %cl
67 ; HYBRID-NEXT: shrb $3, %sil
68 ; HYBRID-NEXT: negb %sil
69 ; HYBRID-NEXT: movsbq %sil, %rdx
70 ; HYBRID-NEXT: movq -16(%rsp,%rdx), %rsi
71 ; HYBRID-NEXT: movq -8(%rsp,%rdx), %rdi
72 ; HYBRID-NEXT: shldq %cl, %rsi, %rdi
73 ; HYBRID-NEXT: movq %rdi, 24(%rax)
74 ; HYBRID-NEXT: movq -32(%rsp,%rdx), %rdi
75 ; HYBRID-NEXT: movq -24(%rsp,%rdx), %rdx
76 ; HYBRID-NEXT: movq %rdx, %r8
77 ; HYBRID-NEXT: shldq %cl, %rdi, %r8
78 ; HYBRID-NEXT: movq %r8, 8(%rax)
79 ; HYBRID-NEXT: shlq %cl, %rdi
80 ; HYBRID-NEXT: movq %rdi, (%rax)
81 ; HYBRID-NEXT: shlq %cl, %rsi
82 ; HYBRID-NEXT: notb %cl
83 ; HYBRID-NEXT: shrq %rdx
84 ; HYBRID-NEXT: shrq %cl, %rdx
85 ; HYBRID-NEXT: orq %rsi, %rdx
86 ; HYBRID-NEXT: movq %rdx, 16(%rax)
91 ; BURR-NEXT: movq %rdi, %rax
92 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
93 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
94 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
95 ; BURR-NEXT: movq $1, -{{[0-9]+}}(%rsp)
96 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
97 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
98 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
99 ; BURR-NEXT: movq $0, -{{[0-9]+}}(%rsp)
100 ; BURR-NEXT: addl %esi, %esi
101 ; BURR-NEXT: addb $3, %sil
102 ; BURR-NEXT: movl %esi, %ecx
103 ; BURR-NEXT: andb $7, %cl
104 ; BURR-NEXT: shrb $3, %sil
105 ; BURR-NEXT: negb %sil
106 ; BURR-NEXT: movsbq %sil, %rdx
107 ; BURR-NEXT: movq -16(%rsp,%rdx), %rsi
108 ; BURR-NEXT: movq -8(%rsp,%rdx), %rdi
109 ; BURR-NEXT: shldq %cl, %rsi, %rdi
110 ; BURR-NEXT: movq %rdi, 24(%rax)
111 ; BURR-NEXT: movq -32(%rsp,%rdx), %rdi
112 ; BURR-NEXT: movq -24(%rsp,%rdx), %rdx
113 ; BURR-NEXT: movq %rdx, %r8
114 ; BURR-NEXT: shldq %cl, %rdi, %r8
115 ; BURR-NEXT: movq %r8, 8(%rax)
116 ; BURR-NEXT: shlq %cl, %rdi
117 ; BURR-NEXT: movq %rdi, (%rax)
118 ; BURR-NEXT: shlq %cl, %rsi
119 ; BURR-NEXT: notb %cl
120 ; BURR-NEXT: shrq %rdx
121 ; BURR-NEXT: shrq %cl, %rdx
122 ; BURR-NEXT: orq %rsi, %rdx
123 ; BURR-NEXT: movq %rdx, 16(%rax)
128 ; SRC-NEXT: movq %rdi, %rax
129 ; SRC-NEXT: addl %esi, %esi
130 ; SRC-NEXT: addb $3, %sil
131 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
132 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
133 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
134 ; SRC-NEXT: movq $1, -{{[0-9]+}}(%rsp)
135 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
136 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
137 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
138 ; SRC-NEXT: movq $0, -{{[0-9]+}}(%rsp)
139 ; SRC-NEXT: movl %esi, %edx
140 ; SRC-NEXT: andb $7, %dl
141 ; SRC-NEXT: shrb $3, %sil
142 ; SRC-NEXT: negb %sil
143 ; SRC-NEXT: movsbq %sil, %rsi
144 ; SRC-NEXT: movq -16(%rsp,%rsi), %rdi
145 ; SRC-NEXT: movq %rdi, %r8
146 ; SRC-NEXT: movl %edx, %ecx
147 ; SRC-NEXT: shlq %cl, %r8
149 ; SRC-NEXT: movq -32(%rsp,%rsi), %r9
150 ; SRC-NEXT: movq -24(%rsp,%rsi), %r10
151 ; SRC-NEXT: movq %r10, %r11
152 ; SRC-NEXT: shrq %r11
153 ; SRC-NEXT: shrq %cl, %r11
154 ; SRC-NEXT: orq %r8, %r11
155 ; SRC-NEXT: movq -8(%rsp,%rsi), %rsi
156 ; SRC-NEXT: movl %edx, %ecx
157 ; SRC-NEXT: shldq %cl, %rdi, %rsi
158 ; SRC-NEXT: movq %r9, %rdi
159 ; SRC-NEXT: shlq %cl, %rdi
160 ; SRC-NEXT: shldq %cl, %r9, %r10
161 ; SRC-NEXT: movq %rsi, 24(%rax)
162 ; SRC-NEXT: movq %r10, 8(%rax)
163 ; SRC-NEXT: movq %rdi, (%rax)
164 ; SRC-NEXT: movq %r11, 16(%rax)
169 ; LIN-NEXT: movq %rdi, %rax
170 ; LIN-NEXT: leal (%rsi,%rsi), %edx
171 ; LIN-NEXT: addb $3, %dl
172 ; LIN-NEXT: movl %edx, %ecx
173 ; LIN-NEXT: shrb $3, %cl
175 ; LIN-NEXT: movsbq %cl, %rsi
176 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
177 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
178 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
179 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
180 ; LIN-NEXT: movq $1, -{{[0-9]+}}(%rsp)
181 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
182 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
183 ; LIN-NEXT: movq $0, -{{[0-9]+}}(%rsp)
184 ; LIN-NEXT: movq -32(%rsp,%rsi), %rdi
185 ; LIN-NEXT: andb $7, %dl
186 ; LIN-NEXT: movq %rdi, %r8
187 ; LIN-NEXT: movl %edx, %ecx
188 ; LIN-NEXT: shlq %cl, %r8
189 ; LIN-NEXT: movq %r8, (%rax)
190 ; LIN-NEXT: movq -24(%rsp,%rsi), %r8
191 ; LIN-NEXT: movq %r8, %r9
192 ; LIN-NEXT: shldq %cl, %rdi, %r9
193 ; LIN-NEXT: movq %r9, 8(%rax)
194 ; LIN-NEXT: movq -16(%rsp,%rsi), %rdi
195 ; LIN-NEXT: movq %rdi, %r9
196 ; LIN-NEXT: shlq %cl, %r9
199 ; LIN-NEXT: shrq %cl, %r8
200 ; LIN-NEXT: orq %r9, %r8
201 ; LIN-NEXT: movq %r8, 16(%rax)
202 ; LIN-NEXT: movq -8(%rsp,%rsi), %rsi
203 ; LIN-NEXT: movl %edx, %ecx
204 ; LIN-NEXT: shldq %cl, %rdi, %rsi
205 ; LIN-NEXT: movq %rsi, 24(%rax)
210 %v = lshr i256 %b, %p
211 %t = trunc i256 %v to i1
213 %f = select i1 %t, i256 undef, i256 %c
217 define i256 @test2(i256 %a) nounwind {
220 ; ILP-NEXT: movq %rdi, %rax
221 ; ILP-NEXT: xorps %xmm0, %xmm0
222 ; ILP-NEXT: movaps %xmm0, 16(%rdi)
223 ; ILP-NEXT: xorl %edi, %edi
224 ; ILP-NEXT: movq %rsi, %r11
225 ; ILP-NEXT: negq %r11
226 ; ILP-NEXT: movl $0, %r10d
227 ; ILP-NEXT: sbbq %rdx, %r10
228 ; ILP-NEXT: movl $0, %r9d
229 ; ILP-NEXT: sbbq %rcx, %r9
230 ; ILP-NEXT: sbbq %r8, %rdi
231 ; ILP-NEXT: andq %r8, %rdi
232 ; ILP-NEXT: bsrq %rdi, %r8
233 ; ILP-NEXT: andq %rdx, %r10
234 ; ILP-NEXT: bsrq %r10, %rdx
235 ; ILP-NEXT: xorq $63, %r8
236 ; ILP-NEXT: andq %rcx, %r9
237 ; ILP-NEXT: bsrq %r9, %rcx
238 ; ILP-NEXT: xorq $63, %rcx
239 ; ILP-NEXT: addq $64, %rcx
240 ; ILP-NEXT: testq %rdi, %rdi
241 ; ILP-NEXT: cmovneq %r8, %rcx
242 ; ILP-NEXT: xorq $63, %rdx
243 ; ILP-NEXT: andq %rsi, %r11
244 ; ILP-NEXT: movl $127, %esi
245 ; ILP-NEXT: bsrq %r11, %r8
246 ; ILP-NEXT: cmoveq %rsi, %r8
247 ; ILP-NEXT: xorq $63, %r8
248 ; ILP-NEXT: addq $64, %r8
249 ; ILP-NEXT: testq %r10, %r10
250 ; ILP-NEXT: cmovneq %rdx, %r8
251 ; ILP-NEXT: subq $-128, %r8
252 ; ILP-NEXT: orq %rdi, %r9
253 ; ILP-NEXT: cmovneq %rcx, %r8
254 ; ILP-NEXT: movq %r8, (%rax)
255 ; ILP-NEXT: movq $0, 8(%rax)
258 ; HYBRID-LABEL: test2:
260 ; HYBRID-NEXT: movq %rdi, %rax
261 ; HYBRID-NEXT: xorps %xmm0, %xmm0
262 ; HYBRID-NEXT: movaps %xmm0, 16(%rdi)
263 ; HYBRID-NEXT: xorl %edi, %edi
264 ; HYBRID-NEXT: movq %rsi, %r11
265 ; HYBRID-NEXT: negq %r11
266 ; HYBRID-NEXT: movl $0, %r10d
267 ; HYBRID-NEXT: sbbq %rdx, %r10
268 ; HYBRID-NEXT: movl $0, %r9d
269 ; HYBRID-NEXT: sbbq %rcx, %r9
270 ; HYBRID-NEXT: sbbq %r8, %rdi
271 ; HYBRID-NEXT: andq %r8, %rdi
272 ; HYBRID-NEXT: bsrq %rdi, %r8
273 ; HYBRID-NEXT: xorq $63, %r8
274 ; HYBRID-NEXT: andq %rcx, %r9
275 ; HYBRID-NEXT: bsrq %r9, %rcx
276 ; HYBRID-NEXT: xorq $63, %rcx
277 ; HYBRID-NEXT: addq $64, %rcx
278 ; HYBRID-NEXT: testq %rdi, %rdi
279 ; HYBRID-NEXT: cmovneq %r8, %rcx
280 ; HYBRID-NEXT: andq %rdx, %r10
281 ; HYBRID-NEXT: bsrq %r10, %rdx
282 ; HYBRID-NEXT: xorq $63, %rdx
283 ; HYBRID-NEXT: andq %rsi, %r11
284 ; HYBRID-NEXT: movl $127, %esi
285 ; HYBRID-NEXT: bsrq %r11, %r8
286 ; HYBRID-NEXT: cmoveq %rsi, %r8
287 ; HYBRID-NEXT: xorq $63, %r8
288 ; HYBRID-NEXT: addq $64, %r8
289 ; HYBRID-NEXT: testq %r10, %r10
290 ; HYBRID-NEXT: cmovneq %rdx, %r8
291 ; HYBRID-NEXT: subq $-128, %r8
292 ; HYBRID-NEXT: orq %rdi, %r9
293 ; HYBRID-NEXT: cmovneq %rcx, %r8
294 ; HYBRID-NEXT: movq %r8, (%rax)
295 ; HYBRID-NEXT: movq $0, 8(%rax)
300 ; BURR-NEXT: movq %rdi, %rax
301 ; BURR-NEXT: xorps %xmm0, %xmm0
302 ; BURR-NEXT: movaps %xmm0, 16(%rdi)
303 ; BURR-NEXT: xorl %edi, %edi
304 ; BURR-NEXT: movq %rsi, %r11
305 ; BURR-NEXT: negq %r11
306 ; BURR-NEXT: movl $0, %r10d
307 ; BURR-NEXT: sbbq %rdx, %r10
308 ; BURR-NEXT: movl $0, %r9d
309 ; BURR-NEXT: sbbq %rcx, %r9
310 ; BURR-NEXT: sbbq %r8, %rdi
311 ; BURR-NEXT: andq %r8, %rdi
312 ; BURR-NEXT: bsrq %rdi, %r8
313 ; BURR-NEXT: xorq $63, %r8
314 ; BURR-NEXT: andq %rcx, %r9
315 ; BURR-NEXT: bsrq %r9, %rcx
316 ; BURR-NEXT: xorq $63, %rcx
317 ; BURR-NEXT: addq $64, %rcx
318 ; BURR-NEXT: testq %rdi, %rdi
319 ; BURR-NEXT: cmovneq %r8, %rcx
320 ; BURR-NEXT: andq %rdx, %r10
321 ; BURR-NEXT: bsrq %r10, %rdx
322 ; BURR-NEXT: xorq $63, %rdx
323 ; BURR-NEXT: andq %rsi, %r11
324 ; BURR-NEXT: movl $127, %esi
325 ; BURR-NEXT: bsrq %r11, %r8
326 ; BURR-NEXT: cmoveq %rsi, %r8
327 ; BURR-NEXT: xorq $63, %r8
328 ; BURR-NEXT: addq $64, %r8
329 ; BURR-NEXT: testq %r10, %r10
330 ; BURR-NEXT: cmovneq %rdx, %r8
331 ; BURR-NEXT: subq $-128, %r8
332 ; BURR-NEXT: orq %rdi, %r9
333 ; BURR-NEXT: cmovneq %rcx, %r8
334 ; BURR-NEXT: movq %r8, (%rax)
335 ; BURR-NEXT: movq $0, 8(%rax)
340 ; SRC-NEXT: movq %rdi, %rax
341 ; SRC-NEXT: xorl %edi, %edi
342 ; SRC-NEXT: movq %rsi, %r11
343 ; SRC-NEXT: negq %r11
344 ; SRC-NEXT: movl $0, %r10d
345 ; SRC-NEXT: sbbq %rdx, %r10
346 ; SRC-NEXT: movl $0, %r9d
347 ; SRC-NEXT: sbbq %rcx, %r9
348 ; SRC-NEXT: sbbq %r8, %rdi
349 ; SRC-NEXT: andq %rdx, %r10
350 ; SRC-NEXT: andq %rcx, %r9
351 ; SRC-NEXT: andq %r8, %rdi
352 ; SRC-NEXT: andq %rsi, %r11
353 ; SRC-NEXT: bsrq %rdi, %rcx
354 ; SRC-NEXT: xorq $63, %rcx
355 ; SRC-NEXT: bsrq %r9, %rdx
356 ; SRC-NEXT: xorq $63, %rdx
357 ; SRC-NEXT: addq $64, %rdx
358 ; SRC-NEXT: testq %rdi, %rdi
359 ; SRC-NEXT: cmovneq %rcx, %rdx
360 ; SRC-NEXT: bsrq %r10, %rcx
361 ; SRC-NEXT: xorq $63, %rcx
362 ; SRC-NEXT: bsrq %r11, %rsi
363 ; SRC-NEXT: movl $127, %r8d
364 ; SRC-NEXT: cmovneq %rsi, %r8
365 ; SRC-NEXT: xorq $63, %r8
366 ; SRC-NEXT: addq $64, %r8
367 ; SRC-NEXT: testq %r10, %r10
368 ; SRC-NEXT: cmovneq %rcx, %r8
369 ; SRC-NEXT: subq $-128, %r8
370 ; SRC-NEXT: orq %r9, %rdi
371 ; SRC-NEXT: cmovneq %rdx, %r8
372 ; SRC-NEXT: xorps %xmm0, %xmm0
373 ; SRC-NEXT: movaps %xmm0, 16(%rax)
374 ; SRC-NEXT: movq %r8, (%rax)
375 ; SRC-NEXT: movq $0, 8(%rax)
380 ; LIN-NEXT: movq %rdi, %rax
381 ; LIN-NEXT: xorps %xmm0, %xmm0
382 ; LIN-NEXT: movaps %xmm0, 16(%rdi)
383 ; LIN-NEXT: movq %rsi, %rdi
384 ; LIN-NEXT: negq %rdi
385 ; LIN-NEXT: andq %rsi, %rdi
386 ; LIN-NEXT: bsrq %rdi, %rsi
387 ; LIN-NEXT: movl $127, %edi
388 ; LIN-NEXT: cmovneq %rsi, %rdi
389 ; LIN-NEXT: xorq $63, %rdi
390 ; LIN-NEXT: addq $64, %rdi
391 ; LIN-NEXT: xorl %esi, %esi
392 ; LIN-NEXT: movl $0, %r9d
393 ; LIN-NEXT: sbbq %rdx, %r9
394 ; LIN-NEXT: andq %rdx, %r9
395 ; LIN-NEXT: bsrq %r9, %rdx
396 ; LIN-NEXT: xorq $63, %rdx
397 ; LIN-NEXT: testq %r9, %r9
398 ; LIN-NEXT: cmoveq %rdi, %rdx
399 ; LIN-NEXT: subq $-128, %rdx
400 ; LIN-NEXT: movl $0, %edi
401 ; LIN-NEXT: sbbq %rcx, %rdi
402 ; LIN-NEXT: andq %rcx, %rdi
403 ; LIN-NEXT: bsrq %rdi, %rcx
404 ; LIN-NEXT: xorq $63, %rcx
405 ; LIN-NEXT: addq $64, %rcx
406 ; LIN-NEXT: sbbq %r8, %rsi
407 ; LIN-NEXT: andq %r8, %rsi
408 ; LIN-NEXT: bsrq %rsi, %r8
409 ; LIN-NEXT: xorq $63, %r8
410 ; LIN-NEXT: testq %rsi, %rsi
411 ; LIN-NEXT: cmoveq %rcx, %r8
412 ; LIN-NEXT: orq %rdi, %rsi
413 ; LIN-NEXT: cmoveq %rdx, %r8
414 ; LIN-NEXT: movq %r8, (%rax)
415 ; LIN-NEXT: movq $0, 8(%rax)
419 %d = call i256 @llvm.ctlz.i256(i256 %c, i1 false)
423 define i256 @test3(i256 %n) nounwind {
426 ; ILP-NEXT: pushq %rbx
427 ; ILP-NEXT: movq %rdi, %rax
428 ; ILP-NEXT: xorps %xmm0, %xmm0
429 ; ILP-NEXT: movaps %xmm0, 16(%rdi)
430 ; ILP-NEXT: xorl %r9d, %r9d
431 ; ILP-NEXT: movq %rsi, %rdi
432 ; ILP-NEXT: negq %rdi
433 ; ILP-NEXT: movl $0, %r10d
434 ; ILP-NEXT: sbbq %rdx, %r10
435 ; ILP-NEXT: movl $0, %r11d
436 ; ILP-NEXT: sbbq %rcx, %r11
437 ; ILP-NEXT: sbbq %r8, %r9
439 ; ILP-NEXT: andq %r9, %r8
440 ; ILP-NEXT: bsrq %r8, %rbx
441 ; ILP-NEXT: notq %rdx
442 ; ILP-NEXT: andq %r10, %rdx
443 ; ILP-NEXT: bsrq %rdx, %r9
444 ; ILP-NEXT: xorq $63, %rbx
445 ; ILP-NEXT: notq %rcx
446 ; ILP-NEXT: andq %r11, %rcx
447 ; ILP-NEXT: bsrq %rcx, %r10
448 ; ILP-NEXT: xorq $63, %r10
449 ; ILP-NEXT: addq $64, %r10
450 ; ILP-NEXT: notq %rsi
451 ; ILP-NEXT: testq %r8, %r8
452 ; ILP-NEXT: cmovneq %rbx, %r10
453 ; ILP-NEXT: xorq $63, %r9
454 ; ILP-NEXT: andq %rdi, %rsi
455 ; ILP-NEXT: movl $127, %edi
456 ; ILP-NEXT: bsrq %rsi, %rsi
457 ; ILP-NEXT: cmoveq %rdi, %rsi
458 ; ILP-NEXT: xorq $63, %rsi
459 ; ILP-NEXT: addq $64, %rsi
460 ; ILP-NEXT: testq %rdx, %rdx
461 ; ILP-NEXT: cmovneq %r9, %rsi
462 ; ILP-NEXT: subq $-128, %rsi
463 ; ILP-NEXT: orq %r8, %rcx
464 ; ILP-NEXT: cmovneq %r10, %rsi
465 ; ILP-NEXT: movq %rsi, (%rax)
466 ; ILP-NEXT: movq $0, 8(%rax)
467 ; ILP-NEXT: popq %rbx
470 ; HYBRID-LABEL: test3:
472 ; HYBRID-NEXT: pushq %rbx
473 ; HYBRID-NEXT: movq %rdi, %rax
474 ; HYBRID-NEXT: xorps %xmm0, %xmm0
475 ; HYBRID-NEXT: movaps %xmm0, 16(%rdi)
476 ; HYBRID-NEXT: xorl %r9d, %r9d
477 ; HYBRID-NEXT: movq %rsi, %rdi
478 ; HYBRID-NEXT: negq %rdi
479 ; HYBRID-NEXT: movl $0, %r10d
480 ; HYBRID-NEXT: sbbq %rdx, %r10
481 ; HYBRID-NEXT: movl $0, %r11d
482 ; HYBRID-NEXT: sbbq %rcx, %r11
483 ; HYBRID-NEXT: sbbq %r8, %r9
484 ; HYBRID-NEXT: notq %r8
485 ; HYBRID-NEXT: andq %r9, %r8
486 ; HYBRID-NEXT: bsrq %r8, %rbx
487 ; HYBRID-NEXT: xorq $63, %rbx
488 ; HYBRID-NEXT: notq %rcx
489 ; HYBRID-NEXT: andq %r11, %rcx
490 ; HYBRID-NEXT: bsrq %rcx, %r9
491 ; HYBRID-NEXT: xorq $63, %r9
492 ; HYBRID-NEXT: addq $64, %r9
493 ; HYBRID-NEXT: testq %r8, %r8
494 ; HYBRID-NEXT: cmovneq %rbx, %r9
495 ; HYBRID-NEXT: notq %rdx
496 ; HYBRID-NEXT: andq %r10, %rdx
497 ; HYBRID-NEXT: bsrq %rdx, %r10
498 ; HYBRID-NEXT: xorq $63, %r10
499 ; HYBRID-NEXT: notq %rsi
500 ; HYBRID-NEXT: andq %rdi, %rsi
501 ; HYBRID-NEXT: movl $127, %edi
502 ; HYBRID-NEXT: bsrq %rsi, %rsi
503 ; HYBRID-NEXT: cmoveq %rdi, %rsi
504 ; HYBRID-NEXT: xorq $63, %rsi
505 ; HYBRID-NEXT: addq $64, %rsi
506 ; HYBRID-NEXT: testq %rdx, %rdx
507 ; HYBRID-NEXT: cmovneq %r10, %rsi
508 ; HYBRID-NEXT: subq $-128, %rsi
509 ; HYBRID-NEXT: orq %r8, %rcx
510 ; HYBRID-NEXT: cmovneq %r9, %rsi
511 ; HYBRID-NEXT: movq %rsi, (%rax)
512 ; HYBRID-NEXT: movq $0, 8(%rax)
513 ; HYBRID-NEXT: popq %rbx
518 ; BURR-NEXT: pushq %rbx
519 ; BURR-NEXT: movq %rdi, %rax
520 ; BURR-NEXT: xorps %xmm0, %xmm0
521 ; BURR-NEXT: movaps %xmm0, 16(%rdi)
522 ; BURR-NEXT: xorl %r9d, %r9d
523 ; BURR-NEXT: movq %rsi, %rdi
524 ; BURR-NEXT: negq %rdi
525 ; BURR-NEXT: movl $0, %r10d
526 ; BURR-NEXT: sbbq %rdx, %r10
527 ; BURR-NEXT: movl $0, %r11d
528 ; BURR-NEXT: sbbq %rcx, %r11
529 ; BURR-NEXT: sbbq %r8, %r9
530 ; BURR-NEXT: notq %r8
531 ; BURR-NEXT: andq %r9, %r8
532 ; BURR-NEXT: bsrq %r8, %rbx
533 ; BURR-NEXT: xorq $63, %rbx
534 ; BURR-NEXT: notq %rcx
535 ; BURR-NEXT: andq %r11, %rcx
536 ; BURR-NEXT: bsrq %rcx, %r9
537 ; BURR-NEXT: xorq $63, %r9
538 ; BURR-NEXT: addq $64, %r9
539 ; BURR-NEXT: testq %r8, %r8
540 ; BURR-NEXT: cmovneq %rbx, %r9
541 ; BURR-NEXT: notq %rdx
542 ; BURR-NEXT: andq %r10, %rdx
543 ; BURR-NEXT: bsrq %rdx, %r10
544 ; BURR-NEXT: xorq $63, %r10
545 ; BURR-NEXT: notq %rsi
546 ; BURR-NEXT: andq %rdi, %rsi
547 ; BURR-NEXT: movl $127, %edi
548 ; BURR-NEXT: bsrq %rsi, %rsi
549 ; BURR-NEXT: cmoveq %rdi, %rsi
550 ; BURR-NEXT: xorq $63, %rsi
551 ; BURR-NEXT: addq $64, %rsi
552 ; BURR-NEXT: testq %rdx, %rdx
553 ; BURR-NEXT: cmovneq %r10, %rsi
554 ; BURR-NEXT: subq $-128, %rsi
555 ; BURR-NEXT: orq %r8, %rcx
556 ; BURR-NEXT: cmovneq %r9, %rsi
557 ; BURR-NEXT: movq %rsi, (%rax)
558 ; BURR-NEXT: movq $0, 8(%rax)
559 ; BURR-NEXT: popq %rbx
564 ; SRC-NEXT: movq %rdi, %rax
565 ; SRC-NEXT: movq %rsi, %rdi
566 ; SRC-NEXT: notq %rdi
567 ; SRC-NEXT: xorl %r9d, %r9d
568 ; SRC-NEXT: negq %rsi
569 ; SRC-NEXT: movl $0, %r10d
570 ; SRC-NEXT: sbbq %rdx, %r10
571 ; SRC-NEXT: notq %rdx
572 ; SRC-NEXT: movl $0, %r11d
573 ; SRC-NEXT: sbbq %rcx, %r11
574 ; SRC-NEXT: notq %rcx
575 ; SRC-NEXT: sbbq %r8, %r9
577 ; SRC-NEXT: andq %r10, %rdx
578 ; SRC-NEXT: andq %r11, %rcx
579 ; SRC-NEXT: andq %r9, %r8
580 ; SRC-NEXT: andq %rdi, %rsi
581 ; SRC-NEXT: bsrq %r8, %rdi
582 ; SRC-NEXT: xorq $63, %rdi
583 ; SRC-NEXT: bsrq %rcx, %r9
584 ; SRC-NEXT: xorq $63, %r9
585 ; SRC-NEXT: addq $64, %r9
586 ; SRC-NEXT: testq %r8, %r8
587 ; SRC-NEXT: cmovneq %rdi, %r9
588 ; SRC-NEXT: bsrq %rdx, %rdi
589 ; SRC-NEXT: xorq $63, %rdi
590 ; SRC-NEXT: bsrq %rsi, %rsi
591 ; SRC-NEXT: movl $127, %r10d
592 ; SRC-NEXT: cmovneq %rsi, %r10
593 ; SRC-NEXT: xorq $63, %r10
594 ; SRC-NEXT: addq $64, %r10
595 ; SRC-NEXT: testq %rdx, %rdx
596 ; SRC-NEXT: cmovneq %rdi, %r10
597 ; SRC-NEXT: subq $-128, %r10
598 ; SRC-NEXT: orq %rcx, %r8
599 ; SRC-NEXT: cmovneq %r9, %r10
600 ; SRC-NEXT: xorps %xmm0, %xmm0
601 ; SRC-NEXT: movaps %xmm0, 16(%rax)
602 ; SRC-NEXT: movq %r10, (%rax)
603 ; SRC-NEXT: movq $0, 8(%rax)
608 ; LIN-NEXT: movq %rdi, %rax
609 ; LIN-NEXT: xorps %xmm0, %xmm0
610 ; LIN-NEXT: movaps %xmm0, 16(%rdi)
611 ; LIN-NEXT: movq %rsi, %rdi
612 ; LIN-NEXT: negq %rdi
613 ; LIN-NEXT: notq %rsi
614 ; LIN-NEXT: andq %rdi, %rsi
615 ; LIN-NEXT: bsrq %rsi, %rsi
616 ; LIN-NEXT: movl $127, %r9d
617 ; LIN-NEXT: cmovneq %rsi, %r9
618 ; LIN-NEXT: xorq $63, %r9
619 ; LIN-NEXT: addq $64, %r9
620 ; LIN-NEXT: xorl %edi, %edi
621 ; LIN-NEXT: movl $0, %esi
622 ; LIN-NEXT: sbbq %rdx, %rsi
623 ; LIN-NEXT: notq %rdx
624 ; LIN-NEXT: andq %rsi, %rdx
625 ; LIN-NEXT: bsrq %rdx, %rsi
626 ; LIN-NEXT: xorq $63, %rsi
627 ; LIN-NEXT: testq %rdx, %rdx
628 ; LIN-NEXT: cmoveq %r9, %rsi
629 ; LIN-NEXT: subq $-128, %rsi
630 ; LIN-NEXT: movl $0, %edx
631 ; LIN-NEXT: sbbq %rcx, %rdx
632 ; LIN-NEXT: notq %rcx
633 ; LIN-NEXT: andq %rdx, %rcx
634 ; LIN-NEXT: bsrq %rcx, %rdx
635 ; LIN-NEXT: xorq $63, %rdx
636 ; LIN-NEXT: addq $64, %rdx
637 ; LIN-NEXT: sbbq %r8, %rdi
639 ; LIN-NEXT: andq %rdi, %r8
640 ; LIN-NEXT: bsrq %r8, %rdi
641 ; LIN-NEXT: xorq $63, %rdi
642 ; LIN-NEXT: testq %r8, %r8
643 ; LIN-NEXT: cmoveq %rdx, %rdi
644 ; LIN-NEXT: orq %rcx, %r8
645 ; LIN-NEXT: cmoveq %rsi, %rdi
646 ; LIN-NEXT: movq %rdi, (%rax)
647 ; LIN-NEXT: movq $0, 8(%rax)
652 %z = call i256 @llvm.ctlz.i256(i256 %y, i1 false)
656 declare i256 @llvm.ctlz.i256(i256, i1) nounwind readnone
658 define i64 @test4(i64 %a, i64 %b) nounwind {
661 ; ILP-NEXT: xorl %eax, %eax
662 ; ILP-NEXT: xorl %ecx, %ecx
663 ; ILP-NEXT: incq %rsi
665 ; ILP-NEXT: cmpq %rdi, %rsi
666 ; ILP-NEXT: sbbq $0, %rcx
667 ; ILP-NEXT: movl $0, %ecx
668 ; ILP-NEXT: sbbq %rcx, %rcx
669 ; ILP-NEXT: movl $0, %ecx
670 ; ILP-NEXT: sbbq %rcx, %rcx
671 ; ILP-NEXT: adcq $1, %rax
674 ; HYBRID-LABEL: test4:
676 ; HYBRID-NEXT: xorl %eax, %eax
677 ; HYBRID-NEXT: xorl %ecx, %ecx
678 ; HYBRID-NEXT: incq %rsi
679 ; HYBRID-NEXT: sete %cl
680 ; HYBRID-NEXT: cmpq %rdi, %rsi
681 ; HYBRID-NEXT: sbbq $0, %rcx
682 ; HYBRID-NEXT: movl $0, %ecx
683 ; HYBRID-NEXT: sbbq %rcx, %rcx
684 ; HYBRID-NEXT: movl $0, %ecx
685 ; HYBRID-NEXT: sbbq %rcx, %rcx
686 ; HYBRID-NEXT: adcq $1, %rax
691 ; BURR-NEXT: xorl %eax, %eax
692 ; BURR-NEXT: xorl %ecx, %ecx
693 ; BURR-NEXT: incq %rsi
694 ; BURR-NEXT: sete %cl
695 ; BURR-NEXT: cmpq %rdi, %rsi
696 ; BURR-NEXT: sbbq $0, %rcx
697 ; BURR-NEXT: movl $0, %ecx
698 ; BURR-NEXT: sbbq %rcx, %rcx
699 ; BURR-NEXT: movl $0, %ecx
700 ; BURR-NEXT: sbbq %rcx, %rcx
701 ; BURR-NEXT: adcq $1, %rax
706 ; SRC-NEXT: xorl %ecx, %ecx
707 ; SRC-NEXT: incq %rsi
709 ; SRC-NEXT: xorl %eax, %eax
710 ; SRC-NEXT: cmpq %rdi, %rsi
711 ; SRC-NEXT: sbbq $0, %rcx
712 ; SRC-NEXT: movl $0, %ecx
713 ; SRC-NEXT: sbbq %rcx, %rcx
714 ; SRC-NEXT: movl $0, %ecx
715 ; SRC-NEXT: sbbq %rcx, %rcx
716 ; SRC-NEXT: adcq $1, %rax
721 ; LIN-NEXT: xorl %eax, %eax
722 ; LIN-NEXT: xorl %ecx, %ecx
723 ; LIN-NEXT: incq %rsi
725 ; LIN-NEXT: cmpq %rdi, %rsi
726 ; LIN-NEXT: sbbq $0, %rcx
727 ; LIN-NEXT: movl $0, %ecx
728 ; LIN-NEXT: sbbq %rcx, %rcx
729 ; LIN-NEXT: movl $0, %ecx
730 ; LIN-NEXT: sbbq %rcx, %rcx
731 ; LIN-NEXT: adcq $1, %rax
733 %r = zext i64 %b to i256
735 %w = and i256 %u, 1461501637330902918203684832716283019655932542975
736 %x = zext i64 %a to i256
737 %c = icmp uge i256 %w, %x
738 %y = select i1 %c, i64 0, i64 1
743 define i256 @PR25498(i256 %a) nounwind {
744 ; ILP-LABEL: PR25498:
746 ; ILP-NEXT: pushq %rbx
747 ; ILP-NEXT: movq %rdi, %rax
748 ; ILP-NEXT: xorl %edi, %edi
749 ; ILP-NEXT: movq %rsi, %rbx
750 ; ILP-NEXT: negq %rbx
751 ; ILP-NEXT: movl $0, %r11d
752 ; ILP-NEXT: sbbq %rdx, %r11
753 ; ILP-NEXT: movl $0, %r9d
754 ; ILP-NEXT: sbbq %rcx, %r9
755 ; ILP-NEXT: movl $0, %r10d
756 ; ILP-NEXT: sbbq %r8, %r10
757 ; ILP-NEXT: orq %r8, %rdx
758 ; ILP-NEXT: orq %rcx, %rsi
759 ; ILP-NEXT: orq %rdx, %rsi
760 ; ILP-NEXT: je .LBB4_1
761 ; ILP-NEXT: # %bb.2: # %cond.false
762 ; ILP-NEXT: bsrq %r11, %rdx
763 ; ILP-NEXT: bsrq %r10, %rcx
764 ; ILP-NEXT: xorq $63, %rcx
765 ; ILP-NEXT: bsrq %r9, %rsi
766 ; ILP-NEXT: xorq $63, %rsi
767 ; ILP-NEXT: addq $64, %rsi
768 ; ILP-NEXT: testq %r10, %r10
769 ; ILP-NEXT: cmovneq %rcx, %rsi
770 ; ILP-NEXT: xorq $63, %rdx
771 ; ILP-NEXT: bsrq %rbx, %rcx
772 ; ILP-NEXT: xorq $63, %rcx
773 ; ILP-NEXT: addq $64, %rcx
774 ; ILP-NEXT: testq %r11, %r11
775 ; ILP-NEXT: cmovneq %rdx, %rcx
776 ; ILP-NEXT: subq $-128, %rcx
777 ; ILP-NEXT: xorl %edi, %edi
778 ; ILP-NEXT: orq %r10, %r9
779 ; ILP-NEXT: cmovneq %rsi, %rcx
780 ; ILP-NEXT: jmp .LBB4_3
782 ; ILP-NEXT: movl $256, %ecx # imm = 0x100
783 ; ILP-NEXT: .LBB4_3: # %cond.end
784 ; ILP-NEXT: movq %rcx, (%rax)
785 ; ILP-NEXT: movq %rdi, 8(%rax)
786 ; ILP-NEXT: movq %rdi, 16(%rax)
787 ; ILP-NEXT: movq %rdi, 24(%rax)
788 ; ILP-NEXT: popq %rbx
791 ; HYBRID-LABEL: PR25498:
793 ; HYBRID-NEXT: pushq %rbx
794 ; HYBRID-NEXT: movq %rdi, %rax
795 ; HYBRID-NEXT: xorl %edi, %edi
796 ; HYBRID-NEXT: movq %rsi, %rbx
797 ; HYBRID-NEXT: negq %rbx
798 ; HYBRID-NEXT: movl $0, %r11d
799 ; HYBRID-NEXT: sbbq %rdx, %r11
800 ; HYBRID-NEXT: movl $0, %r9d
801 ; HYBRID-NEXT: sbbq %rcx, %r9
802 ; HYBRID-NEXT: movl $0, %r10d
803 ; HYBRID-NEXT: sbbq %r8, %r10
804 ; HYBRID-NEXT: orq %r8, %rdx
805 ; HYBRID-NEXT: orq %rcx, %rsi
806 ; HYBRID-NEXT: orq %rdx, %rsi
807 ; HYBRID-NEXT: je .LBB4_1
808 ; HYBRID-NEXT: # %bb.2: # %cond.false
809 ; HYBRID-NEXT: bsrq %r10, %rcx
810 ; HYBRID-NEXT: xorq $63, %rcx
811 ; HYBRID-NEXT: bsrq %r9, %rdx
812 ; HYBRID-NEXT: xorq $63, %rdx
813 ; HYBRID-NEXT: addq $64, %rdx
814 ; HYBRID-NEXT: testq %r10, %r10
815 ; HYBRID-NEXT: cmovneq %rcx, %rdx
816 ; HYBRID-NEXT: bsrq %r11, %rsi
817 ; HYBRID-NEXT: xorq $63, %rsi
818 ; HYBRID-NEXT: bsrq %rbx, %rcx
819 ; HYBRID-NEXT: xorq $63, %rcx
820 ; HYBRID-NEXT: addq $64, %rcx
821 ; HYBRID-NEXT: testq %r11, %r11
822 ; HYBRID-NEXT: cmovneq %rsi, %rcx
823 ; HYBRID-NEXT: subq $-128, %rcx
824 ; HYBRID-NEXT: orq %r10, %r9
825 ; HYBRID-NEXT: cmovneq %rdx, %rcx
826 ; HYBRID-NEXT: xorl %edi, %edi
827 ; HYBRID-NEXT: jmp .LBB4_3
828 ; HYBRID-NEXT: .LBB4_1:
829 ; HYBRID-NEXT: movl $256, %ecx # imm = 0x100
830 ; HYBRID-NEXT: .LBB4_3: # %cond.end
831 ; HYBRID-NEXT: movq %rcx, (%rax)
832 ; HYBRID-NEXT: movq %rdi, 8(%rax)
833 ; HYBRID-NEXT: movq %rdi, 16(%rax)
834 ; HYBRID-NEXT: movq %rdi, 24(%rax)
835 ; HYBRID-NEXT: popq %rbx
838 ; BURR-LABEL: PR25498:
840 ; BURR-NEXT: pushq %rbx
841 ; BURR-NEXT: movq %rdi, %rax
842 ; BURR-NEXT: xorl %edi, %edi
843 ; BURR-NEXT: movq %rsi, %rbx
844 ; BURR-NEXT: negq %rbx
845 ; BURR-NEXT: movl $0, %r11d
846 ; BURR-NEXT: sbbq %rdx, %r11
847 ; BURR-NEXT: movl $0, %r9d
848 ; BURR-NEXT: sbbq %rcx, %r9
849 ; BURR-NEXT: movl $0, %r10d
850 ; BURR-NEXT: sbbq %r8, %r10
851 ; BURR-NEXT: orq %r8, %rdx
852 ; BURR-NEXT: orq %rcx, %rsi
853 ; BURR-NEXT: orq %rdx, %rsi
854 ; BURR-NEXT: je .LBB4_1
855 ; BURR-NEXT: # %bb.2: # %cond.false
856 ; BURR-NEXT: bsrq %r10, %rcx
857 ; BURR-NEXT: xorq $63, %rcx
858 ; BURR-NEXT: bsrq %r9, %rdx
859 ; BURR-NEXT: xorq $63, %rdx
860 ; BURR-NEXT: addq $64, %rdx
861 ; BURR-NEXT: testq %r10, %r10
862 ; BURR-NEXT: cmovneq %rcx, %rdx
863 ; BURR-NEXT: bsrq %r11, %rsi
864 ; BURR-NEXT: xorq $63, %rsi
865 ; BURR-NEXT: bsrq %rbx, %rcx
866 ; BURR-NEXT: xorq $63, %rcx
867 ; BURR-NEXT: addq $64, %rcx
868 ; BURR-NEXT: testq %r11, %r11
869 ; BURR-NEXT: cmovneq %rsi, %rcx
870 ; BURR-NEXT: subq $-128, %rcx
871 ; BURR-NEXT: orq %r10, %r9
872 ; BURR-NEXT: cmovneq %rdx, %rcx
873 ; BURR-NEXT: xorl %edi, %edi
874 ; BURR-NEXT: jmp .LBB4_3
875 ; BURR-NEXT: .LBB4_1:
876 ; BURR-NEXT: movl $256, %ecx # imm = 0x100
877 ; BURR-NEXT: .LBB4_3: # %cond.end
878 ; BURR-NEXT: movq %rcx, (%rax)
879 ; BURR-NEXT: movq %rdi, 8(%rax)
880 ; BURR-NEXT: movq %rdi, 16(%rax)
881 ; BURR-NEXT: movq %rdi, 24(%rax)
882 ; BURR-NEXT: popq %rbx
885 ; SRC-LABEL: PR25498:
887 ; SRC-NEXT: pushq %rbx
888 ; SRC-NEXT: movq %rdi, %rax
889 ; SRC-NEXT: xorl %edi, %edi
890 ; SRC-NEXT: movq %rsi, %rbx
891 ; SRC-NEXT: negq %rbx
892 ; SRC-NEXT: movl $0, %r11d
893 ; SRC-NEXT: sbbq %rdx, %r11
894 ; SRC-NEXT: movl $0, %r9d
895 ; SRC-NEXT: sbbq %rcx, %r9
896 ; SRC-NEXT: movl $0, %r10d
897 ; SRC-NEXT: sbbq %r8, %r10
898 ; SRC-NEXT: orq %r8, %rdx
899 ; SRC-NEXT: orq %rcx, %rsi
900 ; SRC-NEXT: orq %rdx, %rsi
901 ; SRC-NEXT: je .LBB4_1
902 ; SRC-NEXT: # %bb.2: # %cond.false
903 ; SRC-NEXT: bsrq %r10, %rcx
904 ; SRC-NEXT: xorq $63, %rcx
905 ; SRC-NEXT: bsrq %r9, %rdx
906 ; SRC-NEXT: xorq $63, %rdx
907 ; SRC-NEXT: addq $64, %rdx
908 ; SRC-NEXT: testq %r10, %r10
909 ; SRC-NEXT: cmovneq %rcx, %rdx
910 ; SRC-NEXT: bsrq %r11, %rsi
911 ; SRC-NEXT: xorq $63, %rsi
912 ; SRC-NEXT: bsrq %rbx, %rcx
913 ; SRC-NEXT: xorq $63, %rcx
914 ; SRC-NEXT: addq $64, %rcx
915 ; SRC-NEXT: testq %r11, %r11
916 ; SRC-NEXT: cmovneq %rsi, %rcx
917 ; SRC-NEXT: subq $-128, %rcx
918 ; SRC-NEXT: orq %r10, %r9
919 ; SRC-NEXT: cmovneq %rdx, %rcx
920 ; SRC-NEXT: xorl %edi, %edi
921 ; SRC-NEXT: jmp .LBB4_3
923 ; SRC-NEXT: movl $256, %ecx # imm = 0x100
924 ; SRC-NEXT: .LBB4_3: # %cond.end
925 ; SRC-NEXT: movq %rcx, (%rax)
926 ; SRC-NEXT: movq %rdi, 8(%rax)
927 ; SRC-NEXT: movq %rdi, 16(%rax)
928 ; SRC-NEXT: movq %rdi, 24(%rax)
929 ; SRC-NEXT: popq %rbx
932 ; LIN-LABEL: PR25498:
934 ; LIN-NEXT: pushq %rbx
935 ; LIN-NEXT: movq %rdi, %rax
936 ; LIN-NEXT: movq %rsi, %rbx
937 ; LIN-NEXT: negq %rbx
938 ; LIN-NEXT: xorl %edi, %edi
939 ; LIN-NEXT: movl $0, %r11d
940 ; LIN-NEXT: sbbq %rdx, %r11
941 ; LIN-NEXT: movl $0, %r9d
942 ; LIN-NEXT: sbbq %rcx, %r9
943 ; LIN-NEXT: movl $0, %r10d
944 ; LIN-NEXT: sbbq %r8, %r10
945 ; LIN-NEXT: orq %rcx, %rsi
946 ; LIN-NEXT: orq %r8, %rdx
947 ; LIN-NEXT: orq %rsi, %rdx
948 ; LIN-NEXT: je .LBB4_1
949 ; LIN-NEXT: # %bb.2: # %cond.false
950 ; LIN-NEXT: bsrq %rbx, %rcx
951 ; LIN-NEXT: xorq $63, %rcx
952 ; LIN-NEXT: addq $64, %rcx
953 ; LIN-NEXT: bsrq %r11, %rdx
954 ; LIN-NEXT: xorq $63, %rdx
955 ; LIN-NEXT: testq %r11, %r11
956 ; LIN-NEXT: cmoveq %rcx, %rdx
957 ; LIN-NEXT: subq $-128, %rdx
958 ; LIN-NEXT: bsrq %r9, %rsi
959 ; LIN-NEXT: xorq $63, %rsi
960 ; LIN-NEXT: addq $64, %rsi
961 ; LIN-NEXT: bsrq %r10, %rcx
962 ; LIN-NEXT: xorq $63, %rcx
963 ; LIN-NEXT: testq %r10, %r10
964 ; LIN-NEXT: cmoveq %rsi, %rcx
965 ; LIN-NEXT: orq %r10, %r9
966 ; LIN-NEXT: cmoveq %rdx, %rcx
967 ; LIN-NEXT: xorl %edi, %edi
968 ; LIN-NEXT: jmp .LBB4_3
970 ; LIN-NEXT: movl $256, %ecx # imm = 0x100
971 ; LIN-NEXT: .LBB4_3: # %cond.end
972 ; LIN-NEXT: movq %rcx, (%rax)
973 ; LIN-NEXT: movq %rdi, 8(%rax)
974 ; LIN-NEXT: movq %rdi, 16(%rax)
975 ; LIN-NEXT: movq %rdi, 24(%rax)
976 ; LIN-NEXT: popq %rbx
979 %cmpz = icmp eq i256 %b, 0
980 br i1 %cmpz, label %cond.end, label %cond.false
983 %d = call i256 @llvm.ctlz.i256(i256 %b, i1 true)
987 %ctz = phi i256 [ 256, %0 ], [ %d, %cond.false ]