[Gmp-commit] /var/hg/gmp: Fix bug in BMI2 detection.

mercurial at gmplib.org mercurial at gmplib.org
Wed May 15 20:51:15 CEST 2024


details:   /var/hg/gmp/rev/ca451d583385
changeset: 18473:ca451d583385
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Wed May 15 20:51:11 2024 +0200
description:
Fix bug in BMI2 detection.

diffstat:

 ChangeLog            |  4 ++++
 mpn/x86_64/fat/fat.c |  2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 1040c6303455 -r ca451d583385 ChangeLog
--- a/ChangeLog	Mon Mar 25 17:57:27 2024 +0100
+++ b/ChangeLog	Wed May 15 20:51:11 2024 +0200
@@ -1,3 +1,7 @@
+2024-05-15 Sven Anderson <sven at anderson.de>
+
+	* mpn/x86_64/fat/fat.c: Fix bug in BMI2 detection.
+
 2024-03-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpz/millerrabin.c: Swap function order to avoid a (wrong) prototype,
diff -r 1040c6303455 -r ca451d583385 mpn/x86_64/fat/fat.c
--- a/mpn/x86_64/fat/fat.c	Mon Mar 25 17:57:27 2024 +0100
+++ b/mpn/x86_64/fat/fat.c	Wed May 15 20:51:11 2024 +0200
@@ -375,6 +375,7 @@
 	      CPUVEC_SETUP_core2;
 	      CPUVEC_SETUP_coreinhm;
 	      CPUVEC_SETUP_coreisbr;
+	      __gmpn_cpuid (dummy_string, 7);
 	      if ((dummy_string[0 + BMI2_BIT / 8] & (1 << (BMI2_BIT % 8))) == 0)
 		break;
 	      CPUVEC_SETUP_coreihwl;
@@ -388,6 +389,7 @@
 	      CPUVEC_SETUP_core2;
 	      CPUVEC_SETUP_coreinhm;
 	      CPUVEC_SETUP_coreisbr;
+	      __gmpn_cpuid (dummy_string, 7);
 	      if ((dummy_string[0 + BMI2_BIT / 8] & (1 << (BMI2_BIT % 8))) == 0)
 		break;
 	      if (gmp_workaround_skylake_cpuid_bug ())


More information about the gmp-commit mailing list