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: pushq %r14
16 ; ILP-NEXT: pushq %rbx
17 ; ILP-NEXT: movq %rdi, %rax
18 ; ILP-NEXT: xorl %r8d, %r8d
19 ; ILP-NEXT: addb %sil, %sil
20 ; ILP-NEXT: addb $2, %sil
21 ; ILP-NEXT: orb $1, %sil
22 ; ILP-NEXT: movl $1, %r10d
23 ; ILP-NEXT: xorl %r14d, %r14d
24 ; ILP-NEXT: movl %esi, %ecx
25 ; ILP-NEXT: shldq %cl, %r10, %r14
26 ; ILP-NEXT: movl $1, %edx
27 ; ILP-NEXT: shlq %cl, %rdx
28 ; ILP-NEXT: movb $-128, %r11b
29 ; ILP-NEXT: subb %sil, %r11b
30 ; ILP-NEXT: leal -128(%rsi), %r9d
31 ; ILP-NEXT: xorl %edi, %edi
32 ; ILP-NEXT: movl %r9d, %ecx
33 ; ILP-NEXT: shldq %cl, %r10, %rdi
34 ; ILP-NEXT: movl $1, %ebx
35 ; ILP-NEXT: shlq %cl, %rbx
36 ; ILP-NEXT: movl %r11d, %ecx
37 ; ILP-NEXT: shrdq %cl, %r8, %r10
38 ; ILP-NEXT: testb $64, %sil
39 ; ILP-NEXT: cmovneq %rdx, %r14
40 ; ILP-NEXT: cmovneq %r8, %rdx
41 ; ILP-NEXT: testb $64, %r11b
42 ; ILP-NEXT: cmovneq %r8, %r10
43 ; ILP-NEXT: testb $64, %r9b
44 ; ILP-NEXT: cmovneq %rbx, %rdi
45 ; ILP-NEXT: cmovneq %r8, %rbx
46 ; ILP-NEXT: testb %sil, %sil
47 ; ILP-NEXT: cmovsq %r8, %r14
48 ; ILP-NEXT: cmovsq %r8, %rdx
49 ; ILP-NEXT: movq %r14, 8(%rax)
50 ; ILP-NEXT: movq %rdx, (%rax)
51 ; ILP-NEXT: cmovnsq %r8, %rdi
52 ; ILP-NEXT: cmoveq %r8, %rdi
53 ; ILP-NEXT: movq %rdi, 24(%rax)
54 ; ILP-NEXT: cmovnsq %r10, %rbx
55 ; ILP-NEXT: cmoveq %r8, %rbx
56 ; ILP-NEXT: movq %rbx, 16(%rax)
61 ; HYBRID-LABEL: test1:
63 ; HYBRID-NEXT: movq %rdi, %rax
64 ; HYBRID-NEXT: addb %sil, %sil
65 ; HYBRID-NEXT: addb $2, %sil
66 ; HYBRID-NEXT: orb $1, %sil
67 ; HYBRID-NEXT: movb $-128, %cl
68 ; HYBRID-NEXT: subb %sil, %cl
69 ; HYBRID-NEXT: xorl %r8d, %r8d
70 ; HYBRID-NEXT: movl $1, %r11d
71 ; HYBRID-NEXT: movl $1, %r9d
72 ; HYBRID-NEXT: shrdq %cl, %r8, %r9
73 ; HYBRID-NEXT: testb $64, %cl
74 ; HYBRID-NEXT: cmovneq %r8, %r9
75 ; HYBRID-NEXT: xorl %r10d, %r10d
76 ; HYBRID-NEXT: movl %esi, %ecx
77 ; HYBRID-NEXT: shldq %cl, %r11, %r10
78 ; HYBRID-NEXT: leal -128(%rsi), %ecx
79 ; HYBRID-NEXT: xorl %edi, %edi
80 ; HYBRID-NEXT: shldq %cl, %r11, %rdi
81 ; HYBRID-NEXT: movl $1, %edx
82 ; HYBRID-NEXT: shlq %cl, %rdx
83 ; HYBRID-NEXT: testb $64, %cl
84 ; HYBRID-NEXT: cmovneq %rdx, %rdi
85 ; HYBRID-NEXT: cmovneq %r8, %rdx
86 ; HYBRID-NEXT: movl %esi, %ecx
87 ; HYBRID-NEXT: shlq %cl, %r11
88 ; HYBRID-NEXT: testb $64, %sil
89 ; HYBRID-NEXT: cmovneq %r11, %r10
90 ; HYBRID-NEXT: cmovneq %r8, %r11
91 ; HYBRID-NEXT: testb %sil, %sil
92 ; HYBRID-NEXT: cmovsq %r8, %r10
93 ; HYBRID-NEXT: movq %r10, 8(%rax)
94 ; HYBRID-NEXT: cmovsq %r8, %r11
95 ; HYBRID-NEXT: movq %r11, (%rax)
96 ; HYBRID-NEXT: cmovnsq %r8, %rdi
97 ; HYBRID-NEXT: cmoveq %r8, %rdi
98 ; HYBRID-NEXT: movq %rdi, 24(%rax)
99 ; HYBRID-NEXT: cmovnsq %r9, %rdx
100 ; HYBRID-NEXT: cmoveq %r8, %rdx
101 ; HYBRID-NEXT: movq %rdx, 16(%rax)
106 ; BURR-NEXT: movq %rdi, %rax
107 ; BURR-NEXT: addb %sil, %sil
108 ; BURR-NEXT: addb $2, %sil
109 ; BURR-NEXT: orb $1, %sil
110 ; BURR-NEXT: movb $-128, %cl
111 ; BURR-NEXT: subb %sil, %cl
112 ; BURR-NEXT: xorl %r8d, %r8d
113 ; BURR-NEXT: movl $1, %r11d
114 ; BURR-NEXT: movl $1, %r9d
115 ; BURR-NEXT: shrdq %cl, %r8, %r9
116 ; BURR-NEXT: testb $64, %cl
117 ; BURR-NEXT: cmovneq %r8, %r9
118 ; BURR-NEXT: xorl %r10d, %r10d
119 ; BURR-NEXT: movl %esi, %ecx
120 ; BURR-NEXT: shldq %cl, %r11, %r10
121 ; BURR-NEXT: leal -128(%rsi), %ecx
122 ; BURR-NEXT: xorl %edi, %edi
123 ; BURR-NEXT: shldq %cl, %r11, %rdi
124 ; BURR-NEXT: movl $1, %edx
125 ; BURR-NEXT: shlq %cl, %rdx
126 ; BURR-NEXT: testb $64, %cl
127 ; BURR-NEXT: cmovneq %rdx, %rdi
128 ; BURR-NEXT: cmovneq %r8, %rdx
129 ; BURR-NEXT: movl %esi, %ecx
130 ; BURR-NEXT: shlq %cl, %r11
131 ; BURR-NEXT: testb $64, %sil
132 ; BURR-NEXT: cmovneq %r11, %r10
133 ; BURR-NEXT: cmovneq %r8, %r11
134 ; BURR-NEXT: testb %sil, %sil
135 ; BURR-NEXT: cmovsq %r8, %r10
136 ; BURR-NEXT: movq %r10, 8(%rax)
137 ; BURR-NEXT: cmovsq %r8, %r11
138 ; BURR-NEXT: movq %r11, (%rax)
139 ; BURR-NEXT: cmovnsq %r8, %rdi
140 ; BURR-NEXT: cmoveq %r8, %rdi
141 ; BURR-NEXT: movq %rdi, 24(%rax)
142 ; BURR-NEXT: cmovnsq %r9, %rdx
143 ; BURR-NEXT: cmoveq %r8, %rdx
144 ; BURR-NEXT: movq %rdx, 16(%rax)
149 ; SRC-NEXT: pushq %rbx
150 ; SRC-NEXT: movq %rdi, %rax
151 ; SRC-NEXT: addb %sil, %sil
152 ; SRC-NEXT: addb $2, %sil
153 ; SRC-NEXT: orb $1, %sil
154 ; SRC-NEXT: movb $-128, %cl
155 ; SRC-NEXT: subb %sil, %cl
156 ; SRC-NEXT: xorl %r8d, %r8d
157 ; SRC-NEXT: movl $1, %edi
158 ; SRC-NEXT: movl $1, %r10d
159 ; SRC-NEXT: shrdq %cl, %r8, %r10
160 ; SRC-NEXT: testb $64, %cl
161 ; SRC-NEXT: cmovneq %r8, %r10
162 ; SRC-NEXT: leal -128(%rsi), %r9d
163 ; SRC-NEXT: xorl %edx, %edx
164 ; SRC-NEXT: movl %r9d, %ecx
165 ; SRC-NEXT: shldq %cl, %rdi, %rdx
166 ; SRC-NEXT: xorl %r11d, %r11d
167 ; SRC-NEXT: movl %esi, %ecx
168 ; SRC-NEXT: shldq %cl, %rdi, %r11
169 ; SRC-NEXT: movl $1, %ebx
170 ; SRC-NEXT: shlq %cl, %rbx
171 ; SRC-NEXT: testb $64, %sil
172 ; SRC-NEXT: cmovneq %rbx, %r11
173 ; SRC-NEXT: cmovneq %r8, %rbx
174 ; SRC-NEXT: movl %r9d, %ecx
175 ; SRC-NEXT: shlq %cl, %rdi
176 ; SRC-NEXT: testb $64, %r9b
177 ; SRC-NEXT: cmovneq %rdi, %rdx
178 ; SRC-NEXT: cmovneq %r8, %rdi
179 ; SRC-NEXT: testb %sil, %sil
180 ; SRC-NEXT: cmovnsq %r10, %rdi
181 ; SRC-NEXT: cmoveq %r8, %rdi
182 ; SRC-NEXT: cmovnsq %r8, %rdx
183 ; SRC-NEXT: cmoveq %r8, %rdx
184 ; SRC-NEXT: cmovsq %r8, %r11
185 ; SRC-NEXT: cmovsq %r8, %rbx
186 ; SRC-NEXT: movq %r11, 8(%rax)
187 ; SRC-NEXT: movq %rbx, (%rax)
188 ; SRC-NEXT: movq %rdx, 24(%rax)
189 ; SRC-NEXT: movq %rdi, 16(%rax)
190 ; SRC-NEXT: popq %rbx
195 ; LIN-NEXT: movq %rdi, %rax
196 ; LIN-NEXT: xorl %r9d, %r9d
197 ; LIN-NEXT: movl $1, %r8d
198 ; LIN-NEXT: addb %sil, %sil
199 ; LIN-NEXT: addb $2, %sil
200 ; LIN-NEXT: orb $1, %sil
201 ; LIN-NEXT: movl $1, %edx
202 ; LIN-NEXT: movl %esi, %ecx
203 ; LIN-NEXT: shlq %cl, %rdx
204 ; LIN-NEXT: testb $64, %sil
205 ; LIN-NEXT: movq %rdx, %rcx
206 ; LIN-NEXT: cmovneq %r9, %rcx
207 ; LIN-NEXT: testb %sil, %sil
208 ; LIN-NEXT: cmovsq %r9, %rcx
209 ; LIN-NEXT: movq %rcx, (%rdi)
210 ; LIN-NEXT: xorl %edi, %edi
211 ; LIN-NEXT: movl %esi, %ecx
212 ; LIN-NEXT: shldq %cl, %r8, %rdi
213 ; LIN-NEXT: cmovneq %rdx, %rdi
214 ; LIN-NEXT: cmovsq %r9, %rdi
215 ; LIN-NEXT: movq %rdi, 8(%rax)
216 ; LIN-NEXT: leal -128(%rsi), %r10d
217 ; LIN-NEXT: movl $1, %edx
218 ; LIN-NEXT: movl %r10d, %ecx
219 ; LIN-NEXT: shlq %cl, %rdx
220 ; LIN-NEXT: testb $64, %r10b
221 ; LIN-NEXT: movq %rdx, %rdi
222 ; LIN-NEXT: cmovneq %r9, %rdi
223 ; LIN-NEXT: movb $-128, %cl
224 ; LIN-NEXT: subb %sil, %cl
225 ; LIN-NEXT: movl $1, %esi
226 ; LIN-NEXT: shrdq %cl, %r9, %rsi
227 ; LIN-NEXT: testb $64, %cl
228 ; LIN-NEXT: cmovneq %r9, %rsi
229 ; LIN-NEXT: cmovsq %rdi, %rsi
230 ; LIN-NEXT: cmoveq %r9, %rsi
231 ; LIN-NEXT: movq %rsi, 16(%rax)
232 ; LIN-NEXT: xorl %esi, %esi
233 ; LIN-NEXT: movl %r10d, %ecx
234 ; LIN-NEXT: shldq %cl, %r8, %rsi
235 ; LIN-NEXT: cmovneq %rdx, %rsi
236 ; LIN-NEXT: cmovnsq %r9, %rsi
237 ; LIN-NEXT: cmoveq %r9, %rsi
238 ; LIN-NEXT: movq %rsi, 24(%rax)
243 %v = lshr i256 %b, %p
244 %t = trunc i256 %v to i1
246 %f = select i1 %t, i256 undef, i256 %c
250 define i256 @test2(i256 %a) nounwind {
253 ; ILP-NEXT: movq %rdi, %rax
254 ; ILP-NEXT: xorl %edi, %edi
255 ; ILP-NEXT: movq %rsi, %r11
256 ; ILP-NEXT: negq %r11
257 ; ILP-NEXT: movl $0, %r10d
258 ; ILP-NEXT: sbbq %rdx, %r10
259 ; ILP-NEXT: movl $0, %r9d
260 ; ILP-NEXT: sbbq %rcx, %r9
261 ; ILP-NEXT: sbbq %r8, %rdi
262 ; ILP-NEXT: andq %rcx, %r9
263 ; ILP-NEXT: bsrq %r9, %rcx
264 ; ILP-NEXT: xorq $63, %rcx
265 ; ILP-NEXT: andq %r8, %rdi
266 ; ILP-NEXT: bsrq %rdi, %r8
267 ; ILP-NEXT: andq %rdx, %r10
268 ; ILP-NEXT: bsrq %r10, %rdx
269 ; ILP-NEXT: xorq $63, %r8
270 ; ILP-NEXT: addq $64, %rcx
271 ; ILP-NEXT: testq %rdi, %rdi
272 ; ILP-NEXT: movq $0, 24(%rax)
273 ; ILP-NEXT: movq $0, 16(%rax)
274 ; ILP-NEXT: movq $0, 8(%rax)
275 ; ILP-NEXT: cmovneq %r8, %rcx
276 ; ILP-NEXT: xorq $63, %rdx
277 ; ILP-NEXT: andq %rsi, %r11
278 ; ILP-NEXT: movl $127, %r8d
279 ; ILP-NEXT: bsrq %r11, %rsi
280 ; ILP-NEXT: cmoveq %r8, %rsi
281 ; ILP-NEXT: xorq $63, %rsi
282 ; ILP-NEXT: addq $64, %rsi
283 ; ILP-NEXT: testq %r10, %r10
284 ; ILP-NEXT: cmovneq %rdx, %rsi
285 ; ILP-NEXT: subq $-128, %rsi
286 ; ILP-NEXT: orq %r9, %rdi
287 ; ILP-NEXT: cmovneq %rcx, %rsi
288 ; ILP-NEXT: movq %rsi, (%rax)
291 ; HYBRID-LABEL: test2:
293 ; HYBRID-NEXT: movq %rdi, %rax
294 ; HYBRID-NEXT: xorl %r9d, %r9d
295 ; HYBRID-NEXT: movq %rsi, %r11
296 ; HYBRID-NEXT: negq %r11
297 ; HYBRID-NEXT: movl $0, %r10d
298 ; HYBRID-NEXT: sbbq %rdx, %r10
299 ; HYBRID-NEXT: movl $0, %edi
300 ; HYBRID-NEXT: sbbq %rcx, %rdi
301 ; HYBRID-NEXT: sbbq %r8, %r9
302 ; HYBRID-NEXT: andq %r8, %r9
303 ; HYBRID-NEXT: bsrq %r9, %r8
304 ; HYBRID-NEXT: xorq $63, %r8
305 ; HYBRID-NEXT: andq %rcx, %rdi
306 ; HYBRID-NEXT: bsrq %rdi, %rcx
307 ; HYBRID-NEXT: xorq $63, %rcx
308 ; HYBRID-NEXT: addq $64, %rcx
309 ; HYBRID-NEXT: testq %r9, %r9
310 ; HYBRID-NEXT: cmovneq %r8, %rcx
311 ; HYBRID-NEXT: andq %rdx, %r10
312 ; HYBRID-NEXT: bsrq %r10, %rdx
313 ; HYBRID-NEXT: xorq $63, %rdx
314 ; HYBRID-NEXT: andq %rsi, %r11
315 ; HYBRID-NEXT: movl $127, %r8d
316 ; HYBRID-NEXT: bsrq %r11, %rsi
317 ; HYBRID-NEXT: cmoveq %r8, %rsi
318 ; HYBRID-NEXT: xorq $63, %rsi
319 ; HYBRID-NEXT: addq $64, %rsi
320 ; HYBRID-NEXT: testq %r10, %r10
321 ; HYBRID-NEXT: cmovneq %rdx, %rsi
322 ; HYBRID-NEXT: subq $-128, %rsi
323 ; HYBRID-NEXT: orq %r9, %rdi
324 ; HYBRID-NEXT: cmovneq %rcx, %rsi
325 ; HYBRID-NEXT: movq %rsi, (%rax)
326 ; HYBRID-NEXT: movq $0, 24(%rax)
327 ; HYBRID-NEXT: movq $0, 16(%rax)
328 ; HYBRID-NEXT: movq $0, 8(%rax)
333 ; BURR-NEXT: movq %rdi, %rax
334 ; BURR-NEXT: xorl %r9d, %r9d
335 ; BURR-NEXT: movq %rsi, %r11
336 ; BURR-NEXT: negq %r11
337 ; BURR-NEXT: movl $0, %r10d
338 ; BURR-NEXT: sbbq %rdx, %r10
339 ; BURR-NEXT: movl $0, %edi
340 ; BURR-NEXT: sbbq %rcx, %rdi
341 ; BURR-NEXT: sbbq %r8, %r9
342 ; BURR-NEXT: andq %r8, %r9
343 ; BURR-NEXT: bsrq %r9, %r8
344 ; BURR-NEXT: xorq $63, %r8
345 ; BURR-NEXT: andq %rcx, %rdi
346 ; BURR-NEXT: bsrq %rdi, %rcx
347 ; BURR-NEXT: xorq $63, %rcx
348 ; BURR-NEXT: addq $64, %rcx
349 ; BURR-NEXT: testq %r9, %r9
350 ; BURR-NEXT: cmovneq %r8, %rcx
351 ; BURR-NEXT: andq %rdx, %r10
352 ; BURR-NEXT: bsrq %r10, %rdx
353 ; BURR-NEXT: xorq $63, %rdx
354 ; BURR-NEXT: andq %rsi, %r11
355 ; BURR-NEXT: movl $127, %r8d
356 ; BURR-NEXT: bsrq %r11, %rsi
357 ; BURR-NEXT: cmoveq %r8, %rsi
358 ; BURR-NEXT: xorq $63, %rsi
359 ; BURR-NEXT: addq $64, %rsi
360 ; BURR-NEXT: testq %r10, %r10
361 ; BURR-NEXT: cmovneq %rdx, %rsi
362 ; BURR-NEXT: subq $-128, %rsi
363 ; BURR-NEXT: orq %r9, %rdi
364 ; BURR-NEXT: cmovneq %rcx, %rsi
365 ; BURR-NEXT: movq %rsi, (%rax)
366 ; BURR-NEXT: movq $0, 24(%rax)
367 ; BURR-NEXT: movq $0, 16(%rax)
368 ; BURR-NEXT: movq $0, 8(%rax)
373 ; SRC-NEXT: movq %rdi, %rax
374 ; SRC-NEXT: xorl %edi, %edi
375 ; SRC-NEXT: movq %rsi, %r11
376 ; SRC-NEXT: negq %r11
377 ; SRC-NEXT: movl $0, %r10d
378 ; SRC-NEXT: sbbq %rdx, %r10
379 ; SRC-NEXT: movl $0, %r9d
380 ; SRC-NEXT: sbbq %rcx, %r9
381 ; SRC-NEXT: sbbq %r8, %rdi
382 ; SRC-NEXT: andq %rdx, %r10
383 ; SRC-NEXT: andq %rcx, %r9
384 ; SRC-NEXT: andq %r8, %rdi
385 ; SRC-NEXT: andq %rsi, %r11
386 ; SRC-NEXT: bsrq %rdi, %rcx
387 ; SRC-NEXT: xorq $63, %rcx
388 ; SRC-NEXT: bsrq %r9, %rdx
389 ; SRC-NEXT: xorq $63, %rdx
390 ; SRC-NEXT: addq $64, %rdx
391 ; SRC-NEXT: testq %rdi, %rdi
392 ; SRC-NEXT: cmovneq %rcx, %rdx
393 ; SRC-NEXT: bsrq %r10, %rcx
394 ; SRC-NEXT: xorq $63, %rcx
395 ; SRC-NEXT: bsrq %r11, %r8
396 ; SRC-NEXT: movl $127, %esi
397 ; SRC-NEXT: cmovneq %r8, %rsi
398 ; SRC-NEXT: xorq $63, %rsi
399 ; SRC-NEXT: addq $64, %rsi
400 ; SRC-NEXT: testq %r10, %r10
401 ; SRC-NEXT: cmovneq %rcx, %rsi
402 ; SRC-NEXT: subq $-128, %rsi
403 ; SRC-NEXT: orq %r9, %rdi
404 ; SRC-NEXT: cmovneq %rdx, %rsi
405 ; SRC-NEXT: movq %rsi, (%rax)
406 ; SRC-NEXT: movq $0, 24(%rax)
407 ; SRC-NEXT: movq $0, 16(%rax)
408 ; SRC-NEXT: movq $0, 8(%rax)
413 ; LIN-NEXT: movq %rdi, %rax
414 ; LIN-NEXT: movq %rsi, %rdi
415 ; LIN-NEXT: negq %rdi
416 ; LIN-NEXT: andq %rsi, %rdi
417 ; LIN-NEXT: bsrq %rdi, %rsi
418 ; LIN-NEXT: movl $127, %edi
419 ; LIN-NEXT: cmovneq %rsi, %rdi
420 ; LIN-NEXT: xorq $63, %rdi
421 ; LIN-NEXT: addq $64, %rdi
422 ; LIN-NEXT: xorl %r9d, %r9d
423 ; LIN-NEXT: movl $0, %esi
424 ; LIN-NEXT: sbbq %rdx, %rsi
425 ; LIN-NEXT: andq %rdx, %rsi
426 ; LIN-NEXT: bsrq %rsi, %rdx
427 ; LIN-NEXT: xorq $63, %rdx
428 ; LIN-NEXT: testq %rsi, %rsi
429 ; LIN-NEXT: cmoveq %rdi, %rdx
430 ; LIN-NEXT: subq $-128, %rdx
431 ; LIN-NEXT: movl $0, %esi
432 ; LIN-NEXT: sbbq %rcx, %rsi
433 ; LIN-NEXT: andq %rcx, %rsi
434 ; LIN-NEXT: bsrq %rsi, %rcx
435 ; LIN-NEXT: xorq $63, %rcx
436 ; LIN-NEXT: addq $64, %rcx
437 ; LIN-NEXT: sbbq %r8, %r9
438 ; LIN-NEXT: andq %r8, %r9
439 ; LIN-NEXT: bsrq %r9, %rdi
440 ; LIN-NEXT: xorq $63, %rdi
441 ; LIN-NEXT: testq %r9, %r9
442 ; LIN-NEXT: cmoveq %rcx, %rdi
443 ; LIN-NEXT: orq %rsi, %r9
444 ; LIN-NEXT: cmoveq %rdx, %rdi
445 ; LIN-NEXT: movq %rdi, (%rax)
446 ; LIN-NEXT: movq $0, 8(%rax)
447 ; LIN-NEXT: movq $0, 16(%rax)
448 ; LIN-NEXT: movq $0, 24(%rax)
452 %d = call i256 @llvm.ctlz.i256(i256 %c, i1 false)
456 define i256 @test3(i256 %n) nounwind {
459 ; ILP-NEXT: movq %rdi, %rax
460 ; ILP-NEXT: xorl %r10d, %r10d
461 ; ILP-NEXT: movq %rsi, %r9
463 ; ILP-NEXT: movl $0, %r11d
464 ; ILP-NEXT: sbbq %rdx, %r11
465 ; ILP-NEXT: movl $0, %edi
466 ; ILP-NEXT: sbbq %rcx, %rdi
467 ; ILP-NEXT: sbbq %r8, %r10
468 ; ILP-NEXT: notq %rcx
469 ; ILP-NEXT: andq %rdi, %rcx
470 ; ILP-NEXT: bsrq %rcx, %rdi
471 ; ILP-NEXT: notq %rdx
472 ; ILP-NEXT: andq %r11, %rdx
473 ; ILP-NEXT: xorq $63, %rdi
475 ; ILP-NEXT: andq %r10, %r8
476 ; ILP-NEXT: bsrq %r8, %r10
477 ; ILP-NEXT: xorq $63, %r10
478 ; ILP-NEXT: addq $64, %rdi
479 ; ILP-NEXT: bsrq %rdx, %r11
480 ; ILP-NEXT: notq %rsi
481 ; ILP-NEXT: testq %r8, %r8
482 ; ILP-NEXT: movq $0, 24(%rax)
483 ; ILP-NEXT: movq $0, 16(%rax)
484 ; ILP-NEXT: movq $0, 8(%rax)
485 ; ILP-NEXT: cmovneq %r10, %rdi
486 ; ILP-NEXT: xorq $63, %r11
487 ; ILP-NEXT: andq %r9, %rsi
488 ; ILP-NEXT: movl $127, %r9d
489 ; ILP-NEXT: bsrq %rsi, %rsi
490 ; ILP-NEXT: cmoveq %r9, %rsi
491 ; ILP-NEXT: xorq $63, %rsi
492 ; ILP-NEXT: addq $64, %rsi
493 ; ILP-NEXT: testq %rdx, %rdx
494 ; ILP-NEXT: cmovneq %r11, %rsi
495 ; ILP-NEXT: subq $-128, %rsi
496 ; ILP-NEXT: orq %rcx, %r8
497 ; ILP-NEXT: cmovneq %rdi, %rsi
498 ; ILP-NEXT: movq %rsi, (%rax)
501 ; HYBRID-LABEL: test3:
503 ; HYBRID-NEXT: pushq %rbx
504 ; HYBRID-NEXT: movq %rdi, %rax
505 ; HYBRID-NEXT: xorl %edi, %edi
506 ; HYBRID-NEXT: movq %rsi, %r9
507 ; HYBRID-NEXT: negq %r9
508 ; HYBRID-NEXT: movl $0, %r10d
509 ; HYBRID-NEXT: sbbq %rdx, %r10
510 ; HYBRID-NEXT: movl $0, %r11d
511 ; HYBRID-NEXT: sbbq %rcx, %r11
512 ; HYBRID-NEXT: sbbq %r8, %rdi
513 ; HYBRID-NEXT: notq %r8
514 ; HYBRID-NEXT: andq %rdi, %r8
515 ; HYBRID-NEXT: bsrq %r8, %rbx
516 ; HYBRID-NEXT: xorq $63, %rbx
517 ; HYBRID-NEXT: notq %rcx
518 ; HYBRID-NEXT: andq %r11, %rcx
519 ; HYBRID-NEXT: bsrq %rcx, %rdi
520 ; HYBRID-NEXT: xorq $63, %rdi
521 ; HYBRID-NEXT: addq $64, %rdi
522 ; HYBRID-NEXT: testq %r8, %r8
523 ; HYBRID-NEXT: cmovneq %rbx, %rdi
524 ; HYBRID-NEXT: notq %rdx
525 ; HYBRID-NEXT: andq %r10, %rdx
526 ; HYBRID-NEXT: bsrq %rdx, %rbx
527 ; HYBRID-NEXT: xorq $63, %rbx
528 ; HYBRID-NEXT: notq %rsi
529 ; HYBRID-NEXT: andq %r9, %rsi
530 ; HYBRID-NEXT: movl $127, %r9d
531 ; HYBRID-NEXT: bsrq %rsi, %rsi
532 ; HYBRID-NEXT: cmoveq %r9, %rsi
533 ; HYBRID-NEXT: xorq $63, %rsi
534 ; HYBRID-NEXT: addq $64, %rsi
535 ; HYBRID-NEXT: testq %rdx, %rdx
536 ; HYBRID-NEXT: cmovneq %rbx, %rsi
537 ; HYBRID-NEXT: subq $-128, %rsi
538 ; HYBRID-NEXT: orq %r8, %rcx
539 ; HYBRID-NEXT: cmovneq %rdi, %rsi
540 ; HYBRID-NEXT: movq %rsi, (%rax)
541 ; HYBRID-NEXT: movq $0, 24(%rax)
542 ; HYBRID-NEXT: movq $0, 16(%rax)
543 ; HYBRID-NEXT: movq $0, 8(%rax)
544 ; HYBRID-NEXT: popq %rbx
549 ; BURR-NEXT: pushq %rbx
550 ; BURR-NEXT: movq %rdi, %rax
551 ; BURR-NEXT: xorl %edi, %edi
552 ; BURR-NEXT: movq %rsi, %r9
553 ; BURR-NEXT: negq %r9
554 ; BURR-NEXT: movl $0, %r10d
555 ; BURR-NEXT: sbbq %rdx, %r10
556 ; BURR-NEXT: movl $0, %r11d
557 ; BURR-NEXT: sbbq %rcx, %r11
558 ; BURR-NEXT: sbbq %r8, %rdi
559 ; BURR-NEXT: notq %r8
560 ; BURR-NEXT: andq %rdi, %r8
561 ; BURR-NEXT: bsrq %r8, %rbx
562 ; BURR-NEXT: xorq $63, %rbx
563 ; BURR-NEXT: notq %rcx
564 ; BURR-NEXT: andq %r11, %rcx
565 ; BURR-NEXT: bsrq %rcx, %rdi
566 ; BURR-NEXT: xorq $63, %rdi
567 ; BURR-NEXT: addq $64, %rdi
568 ; BURR-NEXT: testq %r8, %r8
569 ; BURR-NEXT: cmovneq %rbx, %rdi
570 ; BURR-NEXT: notq %rdx
571 ; BURR-NEXT: andq %r10, %rdx
572 ; BURR-NEXT: bsrq %rdx, %rbx
573 ; BURR-NEXT: xorq $63, %rbx
574 ; BURR-NEXT: notq %rsi
575 ; BURR-NEXT: andq %r9, %rsi
576 ; BURR-NEXT: movl $127, %r9d
577 ; BURR-NEXT: bsrq %rsi, %rsi
578 ; BURR-NEXT: cmoveq %r9, %rsi
579 ; BURR-NEXT: xorq $63, %rsi
580 ; BURR-NEXT: addq $64, %rsi
581 ; BURR-NEXT: testq %rdx, %rdx
582 ; BURR-NEXT: cmovneq %rbx, %rsi
583 ; BURR-NEXT: subq $-128, %rsi
584 ; BURR-NEXT: orq %r8, %rcx
585 ; BURR-NEXT: cmovneq %rdi, %rsi
586 ; BURR-NEXT: movq %rsi, (%rax)
587 ; BURR-NEXT: movq $0, 24(%rax)
588 ; BURR-NEXT: movq $0, 16(%rax)
589 ; BURR-NEXT: movq $0, 8(%rax)
590 ; BURR-NEXT: popq %rbx
595 ; SRC-NEXT: movq %rdi, %rax
596 ; SRC-NEXT: movq %rsi, %r9
598 ; SRC-NEXT: xorl %r10d, %r10d
599 ; SRC-NEXT: negq %rsi
600 ; SRC-NEXT: movl $0, %r11d
601 ; SRC-NEXT: sbbq %rdx, %r11
602 ; SRC-NEXT: notq %rdx
603 ; SRC-NEXT: movl $0, %edi
604 ; SRC-NEXT: sbbq %rcx, %rdi
605 ; SRC-NEXT: notq %rcx
606 ; SRC-NEXT: sbbq %r8, %r10
608 ; SRC-NEXT: andq %r11, %rdx
609 ; SRC-NEXT: andq %rdi, %rcx
610 ; SRC-NEXT: andq %r10, %r8
611 ; SRC-NEXT: andq %r9, %rsi
612 ; SRC-NEXT: bsrq %r8, %r9
613 ; SRC-NEXT: xorq $63, %r9
614 ; SRC-NEXT: bsrq %rcx, %rdi
615 ; SRC-NEXT: xorq $63, %rdi
616 ; SRC-NEXT: addq $64, %rdi
617 ; SRC-NEXT: testq %r8, %r8
618 ; SRC-NEXT: cmovneq %r9, %rdi
619 ; SRC-NEXT: bsrq %rdx, %r9
620 ; SRC-NEXT: xorq $63, %r9
621 ; SRC-NEXT: bsrq %rsi, %r10
622 ; SRC-NEXT: movl $127, %esi
623 ; SRC-NEXT: cmovneq %r10, %rsi
624 ; SRC-NEXT: xorq $63, %rsi
625 ; SRC-NEXT: addq $64, %rsi
626 ; SRC-NEXT: testq %rdx, %rdx
627 ; SRC-NEXT: cmovneq %r9, %rsi
628 ; SRC-NEXT: subq $-128, %rsi
629 ; SRC-NEXT: orq %rcx, %r8
630 ; SRC-NEXT: cmovneq %rdi, %rsi
631 ; SRC-NEXT: movq %rsi, (%rax)
632 ; SRC-NEXT: movq $0, 24(%rax)
633 ; SRC-NEXT: movq $0, 16(%rax)
634 ; SRC-NEXT: movq $0, 8(%rax)
639 ; LIN-NEXT: movq %rdi, %rax
640 ; LIN-NEXT: movq %rsi, %rdi
641 ; LIN-NEXT: negq %rdi
642 ; LIN-NEXT: notq %rsi
643 ; LIN-NEXT: andq %rdi, %rsi
644 ; LIN-NEXT: bsrq %rsi, %rsi
645 ; LIN-NEXT: movl $127, %edi
646 ; LIN-NEXT: cmovneq %rsi, %rdi
647 ; LIN-NEXT: xorq $63, %rdi
648 ; LIN-NEXT: addq $64, %rdi
649 ; LIN-NEXT: xorl %r9d, %r9d
650 ; LIN-NEXT: movl $0, %esi
651 ; LIN-NEXT: sbbq %rdx, %rsi
652 ; LIN-NEXT: notq %rdx
653 ; LIN-NEXT: andq %rsi, %rdx
654 ; LIN-NEXT: bsrq %rdx, %rsi
655 ; LIN-NEXT: xorq $63, %rsi
656 ; LIN-NEXT: testq %rdx, %rdx
657 ; LIN-NEXT: cmoveq %rdi, %rsi
658 ; LIN-NEXT: subq $-128, %rsi
659 ; LIN-NEXT: movl $0, %edx
660 ; LIN-NEXT: sbbq %rcx, %rdx
661 ; LIN-NEXT: notq %rcx
662 ; LIN-NEXT: andq %rdx, %rcx
663 ; LIN-NEXT: bsrq %rcx, %rdx
664 ; LIN-NEXT: xorq $63, %rdx
665 ; LIN-NEXT: addq $64, %rdx
666 ; LIN-NEXT: sbbq %r8, %r9
668 ; LIN-NEXT: andq %r9, %r8
669 ; LIN-NEXT: bsrq %r8, %rdi
670 ; LIN-NEXT: xorq $63, %rdi
671 ; LIN-NEXT: testq %r8, %r8
672 ; LIN-NEXT: cmoveq %rdx, %rdi
673 ; LIN-NEXT: orq %rcx, %r8
674 ; LIN-NEXT: cmoveq %rsi, %rdi
675 ; LIN-NEXT: movq %rdi, (%rax)
676 ; LIN-NEXT: movq $0, 8(%rax)
677 ; LIN-NEXT: movq $0, 16(%rax)
678 ; LIN-NEXT: movq $0, 24(%rax)
683 %z = call i256 @llvm.ctlz.i256(i256 %y, i1 false)
687 declare i256 @llvm.ctlz.i256(i256, i1) nounwind readnone
689 define i64 @test4(i64 %a, i64 %b) nounwind {
692 ; ILP-NEXT: xorl %ecx, %ecx
693 ; ILP-NEXT: xorl %edx, %edx
694 ; ILP-NEXT: incq %rsi
696 ; ILP-NEXT: movl $2, %eax
697 ; ILP-NEXT: cmpq %rdi, %rsi
698 ; ILP-NEXT: sbbq $0, %rdx
699 ; ILP-NEXT: movl $0, %edx
700 ; ILP-NEXT: sbbq %rdx, %rdx
701 ; ILP-NEXT: sbbq %rcx, %rcx
702 ; ILP-NEXT: setae %cl
703 ; ILP-NEXT: movzbl %cl, %ecx
704 ; ILP-NEXT: subq %rcx, %rax
707 ; HYBRID-LABEL: test4:
709 ; HYBRID-NEXT: xorl %eax, %eax
710 ; HYBRID-NEXT: xorl %ecx, %ecx
711 ; HYBRID-NEXT: incq %rsi
712 ; HYBRID-NEXT: sete %cl
713 ; HYBRID-NEXT: cmpq %rdi, %rsi
714 ; HYBRID-NEXT: sbbq $0, %rcx
715 ; HYBRID-NEXT: movl $0, %ecx
716 ; HYBRID-NEXT: sbbq %rcx, %rcx
717 ; HYBRID-NEXT: sbbq %rax, %rax
718 ; HYBRID-NEXT: setae %al
719 ; HYBRID-NEXT: movzbl %al, %ecx
720 ; HYBRID-NEXT: movl $2, %eax
721 ; HYBRID-NEXT: subq %rcx, %rax
726 ; BURR-NEXT: xorl %eax, %eax
727 ; BURR-NEXT: xorl %ecx, %ecx
728 ; BURR-NEXT: incq %rsi
729 ; BURR-NEXT: sete %cl
730 ; BURR-NEXT: cmpq %rdi, %rsi
731 ; BURR-NEXT: sbbq $0, %rcx
732 ; BURR-NEXT: movl $0, %ecx
733 ; BURR-NEXT: sbbq %rcx, %rcx
734 ; BURR-NEXT: sbbq %rax, %rax
735 ; BURR-NEXT: setae %al
736 ; BURR-NEXT: movzbl %al, %ecx
737 ; BURR-NEXT: movl $2, %eax
738 ; BURR-NEXT: subq %rcx, %rax
743 ; SRC-NEXT: xorl %eax, %eax
744 ; SRC-NEXT: incq %rsi
746 ; SRC-NEXT: xorl %ecx, %ecx
747 ; SRC-NEXT: cmpq %rdi, %rsi
748 ; SRC-NEXT: sbbq $0, %rax
749 ; SRC-NEXT: movl $0, %eax
750 ; SRC-NEXT: sbbq %rax, %rax
751 ; SRC-NEXT: sbbq %rcx, %rcx
752 ; SRC-NEXT: setae %al
753 ; SRC-NEXT: movzbl %al, %ecx
754 ; SRC-NEXT: movl $2, %eax
755 ; SRC-NEXT: subq %rcx, %rax
760 ; LIN-NEXT: movl $2, %eax
761 ; LIN-NEXT: xorl %ecx, %ecx
762 ; LIN-NEXT: xorl %edx, %edx
763 ; LIN-NEXT: incq %rsi
765 ; LIN-NEXT: cmpq %rdi, %rsi
766 ; LIN-NEXT: sbbq $0, %rdx
767 ; LIN-NEXT: movl $0, %edx
768 ; LIN-NEXT: sbbq %rdx, %rdx
769 ; LIN-NEXT: sbbq %rcx, %rcx
770 ; LIN-NEXT: setae %cl
771 ; LIN-NEXT: movzbl %cl, %ecx
772 ; LIN-NEXT: subq %rcx, %rax
774 %r = zext i64 %b to i256
776 %w = and i256 %u, 1461501637330902918203684832716283019655932542975
777 %x = zext i64 %a to i256
778 %c = icmp uge i256 %w, %x
779 %y = select i1 %c, i64 0, i64 1
784 define i256 @PR25498(i256 %a) nounwind {
785 ; ILP-LABEL: PR25498:
787 ; ILP-NEXT: pushq %rbx
788 ; ILP-NEXT: movq %rdi, %rax
789 ; ILP-NEXT: xorl %r9d, %r9d
790 ; ILP-NEXT: movq %rsi, %rbx
791 ; ILP-NEXT: negq %rbx
792 ; ILP-NEXT: movl $0, %r11d
793 ; ILP-NEXT: sbbq %rdx, %r11
794 ; ILP-NEXT: movl $0, %r10d
795 ; ILP-NEXT: sbbq %rcx, %r10
796 ; ILP-NEXT: movl $0, %edi
797 ; ILP-NEXT: sbbq %r8, %rdi
798 ; ILP-NEXT: orq %r8, %rdx
799 ; ILP-NEXT: orq %rcx, %rsi
800 ; ILP-NEXT: orq %rdx, %rsi
801 ; ILP-NEXT: je .LBB4_1
802 ; ILP-NEXT: # %bb.2: # %cond.false
803 ; ILP-NEXT: bsrq %r11, %rdx
804 ; ILP-NEXT: bsrq %rdi, %rcx
805 ; ILP-NEXT: xorq $63, %rcx
806 ; ILP-NEXT: bsrq %r10, %rsi
807 ; ILP-NEXT: xorq $63, %rsi
808 ; ILP-NEXT: addq $64, %rsi
809 ; ILP-NEXT: testq %rdi, %rdi
810 ; ILP-NEXT: cmovneq %rcx, %rsi
811 ; ILP-NEXT: xorq $63, %rdx
812 ; ILP-NEXT: bsrq %rbx, %rcx
813 ; ILP-NEXT: xorq $63, %rcx
814 ; ILP-NEXT: addq $64, %rcx
815 ; ILP-NEXT: testq %r11, %r11
816 ; ILP-NEXT: cmovneq %rdx, %rcx
817 ; ILP-NEXT: subq $-128, %rcx
818 ; ILP-NEXT: xorl %r9d, %r9d
819 ; ILP-NEXT: orq %rdi, %r10
820 ; ILP-NEXT: cmovneq %rsi, %rcx
821 ; ILP-NEXT: jmp .LBB4_3
823 ; ILP-NEXT: movl $256, %ecx # imm = 0x100
824 ; ILP-NEXT: .LBB4_3: # %cond.end
825 ; ILP-NEXT: movq %rcx, (%rax)
826 ; ILP-NEXT: movq %r9, 8(%rax)
827 ; ILP-NEXT: movq %r9, 16(%rax)
828 ; ILP-NEXT: movq %r9, 24(%rax)
829 ; ILP-NEXT: popq %rbx
832 ; HYBRID-LABEL: PR25498:
834 ; HYBRID-NEXT: pushq %rbx
835 ; HYBRID-NEXT: movq %rdi, %rax
836 ; HYBRID-NEXT: xorl %r9d, %r9d
837 ; HYBRID-NEXT: movq %rsi, %rbx
838 ; HYBRID-NEXT: negq %rbx
839 ; HYBRID-NEXT: movl $0, %r11d
840 ; HYBRID-NEXT: sbbq %rdx, %r11
841 ; HYBRID-NEXT: movl $0, %r10d
842 ; HYBRID-NEXT: sbbq %rcx, %r10
843 ; HYBRID-NEXT: movl $0, %edi
844 ; HYBRID-NEXT: sbbq %r8, %rdi
845 ; HYBRID-NEXT: orq %r8, %rdx
846 ; HYBRID-NEXT: orq %rcx, %rsi
847 ; HYBRID-NEXT: orq %rdx, %rsi
848 ; HYBRID-NEXT: je .LBB4_1
849 ; HYBRID-NEXT: # %bb.2: # %cond.false
850 ; HYBRID-NEXT: bsrq %rdi, %rcx
851 ; HYBRID-NEXT: xorq $63, %rcx
852 ; HYBRID-NEXT: bsrq %r10, %rdx
853 ; HYBRID-NEXT: xorq $63, %rdx
854 ; HYBRID-NEXT: addq $64, %rdx
855 ; HYBRID-NEXT: testq %rdi, %rdi
856 ; HYBRID-NEXT: cmovneq %rcx, %rdx
857 ; HYBRID-NEXT: bsrq %r11, %rsi
858 ; HYBRID-NEXT: xorq $63, %rsi
859 ; HYBRID-NEXT: bsrq %rbx, %rcx
860 ; HYBRID-NEXT: xorq $63, %rcx
861 ; HYBRID-NEXT: addq $64, %rcx
862 ; HYBRID-NEXT: testq %r11, %r11
863 ; HYBRID-NEXT: cmovneq %rsi, %rcx
864 ; HYBRID-NEXT: subq $-128, %rcx
865 ; HYBRID-NEXT: orq %rdi, %r10
866 ; HYBRID-NEXT: cmovneq %rdx, %rcx
867 ; HYBRID-NEXT: xorl %r9d, %r9d
868 ; HYBRID-NEXT: jmp .LBB4_3
869 ; HYBRID-NEXT: .LBB4_1:
870 ; HYBRID-NEXT: movl $256, %ecx # imm = 0x100
871 ; HYBRID-NEXT: .LBB4_3: # %cond.end
872 ; HYBRID-NEXT: movq %rcx, (%rax)
873 ; HYBRID-NEXT: movq %r9, 8(%rax)
874 ; HYBRID-NEXT: movq %r9, 16(%rax)
875 ; HYBRID-NEXT: movq %r9, 24(%rax)
876 ; HYBRID-NEXT: popq %rbx
879 ; BURR-LABEL: PR25498:
881 ; BURR-NEXT: pushq %rbx
882 ; BURR-NEXT: movq %rdi, %rax
883 ; BURR-NEXT: xorl %r9d, %r9d
884 ; BURR-NEXT: movq %rsi, %rbx
885 ; BURR-NEXT: negq %rbx
886 ; BURR-NEXT: movl $0, %r11d
887 ; BURR-NEXT: sbbq %rdx, %r11
888 ; BURR-NEXT: movl $0, %r10d
889 ; BURR-NEXT: sbbq %rcx, %r10
890 ; BURR-NEXT: movl $0, %edi
891 ; BURR-NEXT: sbbq %r8, %rdi
892 ; BURR-NEXT: orq %r8, %rdx
893 ; BURR-NEXT: orq %rcx, %rsi
894 ; BURR-NEXT: orq %rdx, %rsi
895 ; BURR-NEXT: je .LBB4_1
896 ; BURR-NEXT: # %bb.2: # %cond.false
897 ; BURR-NEXT: bsrq %rdi, %rcx
898 ; BURR-NEXT: xorq $63, %rcx
899 ; BURR-NEXT: bsrq %r10, %rdx
900 ; BURR-NEXT: xorq $63, %rdx
901 ; BURR-NEXT: addq $64, %rdx
902 ; BURR-NEXT: testq %rdi, %rdi
903 ; BURR-NEXT: cmovneq %rcx, %rdx
904 ; BURR-NEXT: bsrq %r11, %rsi
905 ; BURR-NEXT: xorq $63, %rsi
906 ; BURR-NEXT: bsrq %rbx, %rcx
907 ; BURR-NEXT: xorq $63, %rcx
908 ; BURR-NEXT: addq $64, %rcx
909 ; BURR-NEXT: testq %r11, %r11
910 ; BURR-NEXT: cmovneq %rsi, %rcx
911 ; BURR-NEXT: subq $-128, %rcx
912 ; BURR-NEXT: orq %rdi, %r10
913 ; BURR-NEXT: cmovneq %rdx, %rcx
914 ; BURR-NEXT: xorl %r9d, %r9d
915 ; BURR-NEXT: jmp .LBB4_3
916 ; BURR-NEXT: .LBB4_1:
917 ; BURR-NEXT: movl $256, %ecx # imm = 0x100
918 ; BURR-NEXT: .LBB4_3: # %cond.end
919 ; BURR-NEXT: movq %rcx, (%rax)
920 ; BURR-NEXT: movq %r9, 8(%rax)
921 ; BURR-NEXT: movq %r9, 16(%rax)
922 ; BURR-NEXT: movq %r9, 24(%rax)
923 ; BURR-NEXT: popq %rbx
926 ; SRC-LABEL: PR25498:
928 ; SRC-NEXT: pushq %rbx
929 ; SRC-NEXT: movq %rdi, %rax
930 ; SRC-NEXT: xorl %r9d, %r9d
931 ; SRC-NEXT: movq %rsi, %rbx
932 ; SRC-NEXT: negq %rbx
933 ; SRC-NEXT: movl $0, %r11d
934 ; SRC-NEXT: sbbq %rdx, %r11
935 ; SRC-NEXT: movl $0, %r10d
936 ; SRC-NEXT: sbbq %rcx, %r10
937 ; SRC-NEXT: movl $0, %edi
938 ; SRC-NEXT: sbbq %r8, %rdi
939 ; SRC-NEXT: orq %r8, %rdx
940 ; SRC-NEXT: orq %rcx, %rsi
941 ; SRC-NEXT: orq %rdx, %rsi
942 ; SRC-NEXT: je .LBB4_1
943 ; SRC-NEXT: # %bb.2: # %cond.false
944 ; SRC-NEXT: bsrq %rdi, %rcx
945 ; SRC-NEXT: xorq $63, %rcx
946 ; SRC-NEXT: bsrq %r10, %rdx
947 ; SRC-NEXT: xorq $63, %rdx
948 ; SRC-NEXT: addq $64, %rdx
949 ; SRC-NEXT: testq %rdi, %rdi
950 ; SRC-NEXT: cmovneq %rcx, %rdx
951 ; SRC-NEXT: bsrq %r11, %rsi
952 ; SRC-NEXT: xorq $63, %rsi
953 ; SRC-NEXT: bsrq %rbx, %rcx
954 ; SRC-NEXT: xorq $63, %rcx
955 ; SRC-NEXT: addq $64, %rcx
956 ; SRC-NEXT: testq %r11, %r11
957 ; SRC-NEXT: cmovneq %rsi, %rcx
958 ; SRC-NEXT: subq $-128, %rcx
959 ; SRC-NEXT: orq %rdi, %r10
960 ; SRC-NEXT: cmovneq %rdx, %rcx
961 ; SRC-NEXT: xorl %r9d, %r9d
962 ; SRC-NEXT: jmp .LBB4_3
964 ; SRC-NEXT: movl $256, %ecx # imm = 0x100
965 ; SRC-NEXT: .LBB4_3: # %cond.end
966 ; SRC-NEXT: movq %rcx, (%rax)
967 ; SRC-NEXT: movq %r9, 8(%rax)
968 ; SRC-NEXT: movq %r9, 16(%rax)
969 ; SRC-NEXT: movq %r9, 24(%rax)
970 ; SRC-NEXT: popq %rbx
973 ; LIN-LABEL: PR25498:
975 ; LIN-NEXT: pushq %rbx
976 ; LIN-NEXT: movq %rdi, %rax
977 ; LIN-NEXT: movq %rsi, %rbx
978 ; LIN-NEXT: negq %rbx
979 ; LIN-NEXT: xorl %r9d, %r9d
980 ; LIN-NEXT: movl $0, %edi
981 ; LIN-NEXT: sbbq %rdx, %rdi
982 ; LIN-NEXT: movl $0, %r10d
983 ; LIN-NEXT: sbbq %rcx, %r10
984 ; LIN-NEXT: movl $0, %r11d
985 ; LIN-NEXT: sbbq %r8, %r11
986 ; LIN-NEXT: orq %rcx, %rsi
987 ; LIN-NEXT: orq %r8, %rdx
988 ; LIN-NEXT: orq %rsi, %rdx
989 ; LIN-NEXT: je .LBB4_1
990 ; LIN-NEXT: # %bb.2: # %cond.false
991 ; LIN-NEXT: bsrq %rbx, %rcx
992 ; LIN-NEXT: xorq $63, %rcx
993 ; LIN-NEXT: addq $64, %rcx
994 ; LIN-NEXT: bsrq %rdi, %rdx
995 ; LIN-NEXT: xorq $63, %rdx
996 ; LIN-NEXT: testq %rdi, %rdi
997 ; LIN-NEXT: cmoveq %rcx, %rdx
998 ; LIN-NEXT: subq $-128, %rdx
999 ; LIN-NEXT: bsrq %r10, %rsi
1000 ; LIN-NEXT: xorq $63, %rsi
1001 ; LIN-NEXT: addq $64, %rsi
1002 ; LIN-NEXT: bsrq %r11, %rcx
1003 ; LIN-NEXT: xorq $63, %rcx
1004 ; LIN-NEXT: testq %r11, %r11
1005 ; LIN-NEXT: cmoveq %rsi, %rcx
1006 ; LIN-NEXT: orq %r11, %r10
1007 ; LIN-NEXT: cmoveq %rdx, %rcx
1008 ; LIN-NEXT: xorl %r9d, %r9d
1009 ; LIN-NEXT: jmp .LBB4_3
1010 ; LIN-NEXT: .LBB4_1:
1011 ; LIN-NEXT: movl $256, %ecx # imm = 0x100
1012 ; LIN-NEXT: .LBB4_3: # %cond.end
1013 ; LIN-NEXT: movq %rcx, (%rax)
1014 ; LIN-NEXT: movq %r9, 8(%rax)
1015 ; LIN-NEXT: movq %r9, 16(%rax)
1016 ; LIN-NEXT: movq %r9, 24(%rax)
1017 ; LIN-NEXT: popq %rbx
1020 %cmpz = icmp eq i256 %b, 0
1021 br i1 %cmpz, label %cond.end, label %cond.false
1024 %d = call i256 @llvm.ctlz.i256(i256 %b, i1 true)
1028 %ctz = phi i256 [ 256, %0 ], [ %d, %cond.false ]