[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with gmp build



tags 706984 +patch
--

The last gmp upload failed to build on hurd-i386 and kfreebsd-i386
and I could use some help.  The code builds but seven test cases
segfault [1].  Can someone help debug these and hopefully provide
a patch?

It crashes also for me inside kvm.
The key point seems be advertised CPU, not architecture.
The patch bellow suffices for me to pass whole testsuite.

--- mpn/x86/p6/mmx/gmp-mparam.h
+++ mpn/x86/p6/mmx/gmp-mparam.h
@@ -53,7 +53,7 @@
 #define MUL_TOOM42_TO_TOOM63_THRESHOLD      80

 #define SQR_BASECASE_THRESHOLD               0  /* always (native) */
-#define SQR_TOOM2_THRESHOLD                 48
+#define SQR_TOOM2_THRESHOLD                 30
 #define SQR_TOOM3_THRESHOLD                 81
 #define SQR_TOOM4_THRESHOLD                142
 #define SQR_TOOM6_THRESHOLD                258


The upstream should read their own comments in source code ;-)
A few lines before that is:

/* NOTE: In a fat binary build SQR_TOOM2_THRESHOLD here cannot be more than the
   value in mpn/x86/p6/gmp-mparam.h.  The latter is used as a hard limit in
   mpn/x86/p6/sqr_basecase.asm.  */

Guess what value is currently in mpn/x86/p6/gmp-mparam.h ;-)

Petr


Reply to: