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