Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can get a fast equivalent to his zero-padding method on recent-ish x86 and ARM SVE. The x86 assembly would look like (untested):

  compare:  ;; lhs in eax, rhs in ebx
    mov ecx, 0b11111011111101111
    pdep eax, eax, ecx
    pdep ebx, ebx, ecx
    sub eax, ebx
    test eax, 0b10000010000001000
    mov eax, 0
    setnz al
    ret


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: