Skip to content

Instantly share code, notes, and snippets.

@HyperWinX
Created December 2, 2024 14:32
Show Gist options
  • Save HyperWinX/263099afecf1054cb90095a0142350d6 to your computer and use it in GitHub Desktop.
Save HyperWinX/263099afecf1054cb90095a0142350d6 to your computer and use it in GitHub Desktop.
SSE-accelerated strcmpeq implementation
global strcmpeq
strcmpeq:
xor rax, rax
xor rdx, rdx
.loop:
movdqu xmm1, [rdi + rdx]
pcmpistri xmm1, [rsi + rdx], 0x18 ; EQUAL_EACH | NEGATIVE_POLARITY
jc .diff
jz .equal
add rdx, 16
jmp .loop
.equal:
inc eax
.diff:
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment