Skip to content

Instantly share code, notes, and snippets.

@thecppzoo
thecppzoo / strlen_avx2.md
Last active February 22, 2024 20:28
Disassembly of __strlen_avx2 from GLIBC

Since the assembler sources of strlen for AVX2 in GLIBC are virtually obfuscated by the macros, here's the actual assembler: (comments are mine)

Dump of assembler code for function __strlen_avx2: (obtained with GDB disassable)

   0x00007ffff7bf27e0 <+0>:	endbr64 
   0x00007ffff7bf27e4 <+4>:	mov    %edi,%eax
   0x00007ffff7bf27e6 <+6>:	mov    %rdi,%rdx
   0x00007ffff7bf27e9 <+9>:	vpxor  %xmm0,%xmm0,%xmm0