Fix for BMI2 detection for Intel CPUs in fat builds

Sven Anderson sven at anderson.de
Fri May 3 00:26:21 CEST 2024


Hi,

Due to a bug in the BMI2 detection in mpn/x86_64/fat/fat.c (missing load of
the correct CPUID register) the codepath with the BMI2 and ADX instructions
(_coreihwl and _coreibwl suffix) is never being used in fat binaries.
Fixing it gave me a large performance boost. See attached patch.

(Please reply also directly to me, I'm not subscribed to the list.)


Best regards,

Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libgmp-fat.patch
Type: application/octet-stream
Size: 656 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20240503/5ec740aa/attachment.obj>


More information about the gmp-bugs mailing list