File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,26 @@ define i64 @foo(i64 %x, i64 %y) {
21
21
ret i64 %7
22
22
}
23
23
24
+ define i64 @bar (i64 %x , i64 %y ) {
25
+ ; CHECK-LABEL: bar:
26
+ ; CHECK: # %bb.0:
27
+ ; CHECK-NEXT: movl $127, %ecx
28
+ ; CHECK-NEXT: movl $127, %eax
29
+ ; CHECK-NEXT: bsrq %rdi, %rax
30
+ ; CHECK-NEXT: xorq $64, %rax
31
+ ; CHECK-NEXT: bsrq %rsi, %rcx
32
+ ; CHECK-NEXT: cmoveq %rax, %rcx
33
+ ; CHECK-NEXT: movl $63, %eax
34
+ ; CHECK-NEXT: subq %rcx, %rax
35
+ ; CHECK-NEXT: retq
36
+ %1 = tail call i64 @llvm.ctlz.i64 (i64 %x , i1 false )
37
+ %2 = xor i64 %1 , 127
38
+ %3 = tail call i64 @llvm.ctlz.i64 (i64 %y , i1 false )
39
+ %4 = xor i64 %3 , 63
40
+ %5 = icmp eq i64 %y , 0
41
+ %6 = select i1 %5 , i64 %2 , i64 %4
42
+ %7 = sub nsw i64 63 , %6
43
+ ret i64 %7
44
+ }
45
+
24
46
declare i64 @llvm.ctlz.i64 (i64 , i1 )
You can’t perform that action at this time.
0 commit comments