gcd_11 asm
Marco Bodrato
bodrato at mail.dm.unipi.it
Fri Aug 23 17:51:09 UTC 2019
Ciao,
Il Ven, 23 Agosto 2019 3:18 pm, Torbjörn Granlund ha scritto:
> Is it safe to tail-call (jump to, in asm) another function that may not
> have the same return type?
>
> A private call can have any private ABI.
I agree, if it is private.
> Dynamically or statically linked, yes, gcc_11 can be overriden.
I always imagine the static library as a single block, but I should know
(and you are obviously right) that it is not :-)
> The "hidden" attribute could take care of a dynamic library. For
> static, I am not aware of anything which could help.
It is not elegant, I agree, but maybe joining them both in a single .asm
file, so that the jump is local?
> I'd say this is a very generic problem. Our fine library will mishave
> too if somebody overrode mpn_mul_basecase with something incompatible.
If _mul_basecase does not behave as the documented function is supposed
to, of course. But in this case the library will misbehave if somebody
overrides the assembly version of mul_gcd_11 with the C code we distribute
in mpn/generic/gcd_11.c ...
> (I'm not 100% happy with our private ABI between _22 and _11, but for
> now it will serve its purpose well enough, I think.)
For now, I can say that they both are great pieces of code.
Even if... maybe I'd call them _1o1o and _2o2o, as someone suggested :-)
Ĝis,
m
More information about the gmp-devel
mailing list