[GiNaC-devel] Univariate GCD benchmark (Was: some questions)

Alexei Sheplyakov varg at metalica.kh.ua
Fri Feb 6 08:12:22 CET 2009


Hi,

On Thu, Feb 05, 2009 at 09:59:02PM +0100, Richard B. Kreckel wrote:

> I was about to say that my environment is the same. Until I realized:  
> I'm using a 64 bit system!

/me too.

> This suggest the theory that it works in 64 bit systems and doesn't work  
> on 32 bit systems, right?

I've got another theory. There was a bug in chinese_remainder() function.
It's easy to spot it on 32-bit architecture, but not on 64-bit one. If my
theory is correct, the patch below should trigger the bug on 64-bit
architecture. Could you please try it (WITHOUT applying a patch which is
supposed to fix the bug, of course)?


Note: this patch is not supposed to be applied to the `official' repository.

diff --git a/ginac/polynomial/primes_factory.h b/ginac/polynomial/primes_factory.h
index 093c973..d80bff7 100644
--- a/ginac/polynomial/primes_factory.h
+++ b/ginac/polynomial/primes_factory.h
@@ -25,7 +25,7 @@ private:
        cln::cl_I last;
        // This ensures coefficients are immediate.
        static const int immediate_bits = 8*sizeof(void *) - __alignof__(void *);
-       static const long opt_hint = (1L << (immediate_bits >> 1)) - 1;
+       static const long opt_hint = (1L << 14) - 1L;
 public:
        primes_factory()
        {

Best regards,
	Alexei

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20090206/24f6b806/attachment.sig>


More information about the GiNaC-devel mailing list