Last active
May 22, 2017 02:39
-
-
Save fulmicoton/a4f066646d9097dbdacf6dfe5206ed5d to your computer and use it in GitHub Desktop.
branchless binary search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.type _ZN8rust_out13binary_search17hd76cf76916892235E,@function_ZN8rust_out13binary_search17hd76cf76916892235E: | |
.cfi_startproc | |
movl 256(%rdi), %ecx | |
movl $64, %edx | |
xorl %eax, %eax | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 128(%rdi,%rax,4), %ecx | |
leaq 32(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 64(%rdi,%rax,4), %ecx | |
leaq 16(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 32(%rdi,%rax,4), %ecx | |
leaq 8(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 16(%rdi,%rax,4), %ecx | |
leaq 4(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 8(%rdi,%rax,4), %ecx | |
leaq 2(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
movl 4(%rdi,%rax,4), %ecx | |
leaq 1(%rax), %rdx | |
cmpl %ecx, %esi | |
cmovgeq %rdx, %rax | |
retq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment