On Dec 20, 2007 1:40 PM, Nikodemus Siivola <nikodemus@...> wrote:
> My major problem with this is getting the EAX and EBX set
> up for the CALL. The way I do it works, and doesn't reserve
> them up for what is presumably the odd case, but it also fails
> to inform register allocation of how it would be desirable
> to actually pack X to EAX and Y to EBX if it doesn't incur
> any extra costs elsewhere.
I figured out how to solve this in a better way: provide
ALLOC-[UN]SIGNED-BIGNUM-IN-<REG> assembly routines, return
the value in the same reg as the arg is passed in, and generate
a call to the assembly routine using our return register --
so the bignum case becomes
mov <res> <arg>
which is probably as small as it can get.
The attached patch does this, and seems to perform nicely.
I'll probably commit this in early January.