[Top][All Lists]

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

Re: [Lightning] JIT_R11 trashed by jit_callr on MIPS32

From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] JIT_R11 trashed by jit_callr on MIPS32
Date: Mon, 3 Nov 2014 13:05:53 -0200

2014-11-02 21:12 GMT-02:00 Paul Cercueil <address@hidden>:
> Hi,


> I'm working on porting my code to the latest git of Lightning. With success
> so far, I could replace all my arch-dependent hacks without too much
> trouble.

  Nice :) This should also mean it will not rely on undefined behavior
and as long as your code can live with 3 callee save registers, it
should work on all lightning ports.

>>> Well I certainly didn't expect Lightning to use a JIT_R(n) register
>>> internally. I know that those can be trashed when calling C functions,
>>> but I
>>> assumed that they would never be trashed within the generated code.
>>> I think that it would be better to avoid this problem, yes. JIT_R11
>>> should
>>> be removed from the list of available registers. It's not a big deal on
>>> MIPS
>>> anyway, there are plenty of registers that can be used there.
>>    Ok. For consistency with other ports, I will change it to no longer
>> export
>> it. Just note that is possible to have a setup where an argument register
>> is also the return register. The most common case is to have JIT_R0 as
>> the return register, but if the jit code does not return anything, it will
>> not
>> be clobbered.
> Then is it safe to assume that JIT_R0 will be the only register that might
> be clobbered during function calls, across all the supported archs?

  This is true for the current lightning ports, and is a pattern followed pretty
much anywhere, so, it should be safe, at last until some really exotic
architecture and abi appear.

> Regards,
> Paul


reply via email to

[Prev in Thread] Current Thread [Next in Thread]