Home GnuPG

mpi/longlong.h: i386: use tzcnt instruction for trailing zeros

Description

mpi/longlong.h: i386: use tzcnt instruction for trailing zeros

* mpi/longlong.h [__i386__] (count_trailing_zeros): Add 'rep' prefix
for 'bsfq'.

"rep;bsf" aka "tzcnt" is new instruction with well defined operation
on zero input and as result is faster on new CPUs. On old CPUs, "tzcnt"
functions as old "bsf" with undefined behaviour on zero input.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Oct 8 2022, 2:12 PM
Parents
rC38bd31bc46b9: mpi/longlong.h: x86-64: use tzcnt instruction for trailing zeros
Branches
Unknown
Tags
Unknown