Home GnuPG

mpi/longlong.h: x86-64: use tzcnt instruction for trailing zeros

Description

mpi/longlong.h: x86-64: use tzcnt instruction for trailing zeros

* mpi/longlong.h [__x86_64__] (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 2 2022, 9:17 PM
Parents
rCd67f453d1b9d: mpi/longlong: fix generic smul_ppmm ifdef
Branches
Unknown
Tags
Unknown