Created
May 30, 2023 16:34
-
-
Save Unam3dd/12f4f436d77b7a4903a351ebc9475910 to your computer and use it in GitHub Desktop.
Strlen SSE 4.2
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
.intel_syntax noprefix | |
.file "__strlen_sse42" | |
.section .text, "ax" | |
.globl __vs_strlen_sse42 | |
__vs_strlen_sse42: | |
endbr64 | |
xor rax, rax | |
test rdi, rdi | |
jz .L_null | |
mov rdx, rdi | |
pxor xmm0, xmm0 | |
.L_loop: | |
pcmpistri xmm0, xmmword ptr [rdx+rax*1], 0b1000 | |
add eax, ecx | |
test ecx, ecx | |
jnz .L_loop | |
.L_null: | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment