[PATCH] [AArch64] support -mfentry feature for arm64

AKASHI Takahiro takahiro.akashi@linaro.org
Wed Apr 20 00:33:00 GMT 2016


On Tue, Apr 19, 2016 at 09:44:37AM +0300, Alexander Monakov wrote:
> On Tue, 19 Apr 2016, AKASHI Takahiro wrote:
> > > looking at [2] i don't see why
> > > 
> > > func:
> > >   mov x9, x30
> > >   bl _tracefunc
> > >   <function body>
> > 
> > Actually,
> >     mov x9, x30
> >     bl _tracefunc
> >     mov x30, x9
> >     <function body>
> 
> I think here Szabolcs' point was that the last instruction can be eliminated:
> _tracefunc can be responsible for restoring x30, and can use x9 to return to
> its caller. It has a non-standard calling convention and needs to be
> implemented in assembly anyway.

OK, but in _tracefunc, x30 has been updated, and so we should
return as follows:
    mov xTMP, x30
    mov x30, x9
    ret xTMP

We need one more temp register here...

Thanks,
-Takahiro AKASHI

> Alexander



More information about the Gcc-patches mailing list