tune&fat: run-time vs. compile-time constant thresholds

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Sun May 6 11:48:33 CEST 2012


Ciao,

Il Dom, 6 Maggio 2012 7:20 am, bodrato at mail.dm.unipi.it ha scritto:
> Il Ven, 27 Aprile 2012 12:47 pm, Torbjorn Granlund ha scritto:
>> I am not sure exactly what behaviour change you are trying to achieve,
>> but I assume it is good.  :-)
>
> I pushed a few changes to the MAYBE_ mechanism of lower degree toom
> functions, and to the ABOVE_THRESHOLD macro (only for GCC).

Another possible change might be moving the initialized filed outside the
__gmpn_cpuvec struct.

I mean: if we have a global __gmpn_cpuvec_initialized variable, instead of
the field __gmpn_cpuvec.initialized of a global struct, we can easily hide
it with a local declaration.
E.g: all the code calling toom3 checks the thresholds before calling, so
we can safely assume that _cpuvec is intitialised when we are inside the
function. I.e: a simple "const int __gmpn_cpuvec_initialized = 1;" in
toom33_mul.c can safely reduce branches and code size for fat builds.

Please tell me if this can be too dangerous or I can try the trick.

Regards,
m

-- 
http://bodrato.it/software/



More information about the gmp-devel mailing list