destroysCallerSavedRegisters

Doug Simon doug.simon at oracle.com
Mon Aug 26 13:06:31 PDT 2013


On Aug 26, 2013, at 9:55 PM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:

> Hi,
> 
> Can someone explain what does it mean that AMD64Call.destroysCallerSavedRegisters() function returns true?
> 
> In x86, there are registers that it is the responsibility of the caller to save.

That's only according to the native ABI for the platform. HotSpot (or any compiler in fact) is allowed to use a different ABI for calls between compiled code. In the case of Graal on AMD64, for calls between Graal compiled code, we use a caller-saves-all convention (just like C2 as far as I understand).

> This doesn't mean that a function call will clobber them.

In the above mentioned ABI, we have to assume a call clobbers all registers. As you can see in AMD64Call.ForeignCallOp, we set the convention per foreign call.

> So I'm not clear on what it means to say that the call destroys all caller saved registers.
> 
> In HSAIL there is no calling convention as such. Arguments are passed in memory and functions get their own localized view of the entire register set, so there's no way for them to clobber registers used by the caller. Does this mean that HSAILCall.destroysCallerSavedRegisters() should return false?

That sounds right.

-Doug


More information about the graal-dev mailing list