Last active
May 14, 2022 19:47
Star
You must be signed in to star a gist
All nearest smaller values, Barbay, Fischer & Navarro (2012)
This file contains 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
; All nearest smaller values, Barbay, Fischer & Navarro (2012) | |
; https://arxiv.org/abs/1009.5863 | |
; We assume an artificial overall minimum at [rsi] | |
; EAX: [0,N) | |
mov eax,1 | |
@0: lea edx,[rax-1] | |
add eax,1 | |
jmp @1 | |
@2: mov edx,[rdi+rdx*4] | |
@1: mov ecx,[rsi+rax*4-4] | |
cmp ecx,[rsi+rdx*4] | |
jc @2 | |
mov [rdi+rax*4-4],edx | |
cmp eax,N | |
jnz @0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces array of indices in [RDI].