Bill Allombert on Fri, 26 Oct 2012 21:08:59 +0200


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

Re: GCC 4.7.0-11 reverse slowdown


On Mon, Oct 22, 2012 at 07:50:27PM +0200, Bill Allombert wrote:
> Dear PARI developers,
> 
> I have spent the afternoon investigating a strange speedup with
> GCC version 4.7.0-11:
> The function I test is FpX_divrem in PARI 2.5.2 (with GMP 5.0.5).
> 
> The test is:
> install(FpX_divrem,GGG)
> p=nextprime(2^128);
> P=random(p*x^20000);
> Q=random(p*x^10000);
> FpX_divrem(P,Q,p);
> ##
> p=nextprime(2^1280);
> P=random(p*x^10000);
> Q=random(p*x^5000);
> FpX_divrem(P,Q,p);
> ##

I finally found the problem: there was a mistake in the test-suite: indeed
install(FpX_divrem,GGG)
should
install(FpX_divrem,"GGGD&")

Depending on the compiler, the missing argument was either NULL (do not compile
the remainder) or a valid address (compute the remainder). It turns out computing
the remainder is twice slower.

Sorry for the noise.

Cheers,
Bill.