Re: Passing a hidden argument in a dedicated register

2024-12-27 Thread Eric Gallager via Gcc
On Mon, Dec 16, 2024 at 11:43 AM Alexander Monakov wrote: > > > On Mon, 16 Dec 2024, Florian Weimer via Gcc wrote: > > > I would like to provide a facility to create wrapper functions without > > lots of argument shuffling. To achieve that, the wrapping function and > > the wrapped function shoul

Re: Passing a hidden argument in a dedicated register

2024-12-24 Thread Alexander Monakov
On Tue, 24 Dec 2024, Florian Weimer wrote: > * Alexander Monakov: > > > Well, the first paragraph in your initial mail was talking very explicitly > > about making a tailcall from the wrapper, so I guess the goalpost has moved. > > Uhm, I meant a tailcall from the trampoline, not the wrapper.

Re: Passing a hidden argument in a dedicated register

2024-12-24 Thread Florian Weimer
* Alexander Monakov: > Well, the first paragraph in your initial mail was talking very explicitly > about making a tailcall from the wrapper, so I guess the goalpost has moved. Uhm, I meant a tailcall from the trampoline, not the wrapper. >> LD_AUDIT offers outright replacement of the address fo

Re: Passing a hidden argument in a dedicated register

2024-12-23 Thread Alexander Monakov
On Mon, 23 Dec 2024, Florian Weimer via Gcc wrote: > * Alexander Monakov: > >> Does this work on all primary GCC targets? > > > > Yes? I'm not sure why you think it might not work. What are your > > concerns? > > Targets not setting up REGISTER_NAMES, not mentioning the static chain > pointer r

Re: Passing a hidden argument in a dedicated register

2024-12-23 Thread Florian Weimer via Gcc
* Alexander Monakov: >> > Not in a way that will work with LLVM, I'm afraid, and with GCC >> > you'll have to shield wrappers from LTO: >> > >> > register void *r10 asm("r10"); >> > void f(int, int); >> > void f_wrap(int a, int b) >> > { >> > r10 = f; >> > f(a, b); >> > } >> >> Does this

Re: Passing a hidden argument in a dedicated register

2024-12-23 Thread Alexander Monakov
On Mon, 23 Dec 2024, Florian Weimer via Gcc wrote: > * Alexander Monakov: > > > On Mon, 16 Dec 2024, Florian Weimer via Gcc wrote: > > > >> I would like to provide a facility to create wrapper functions without > >> lots of argument shuffling. To achieve that, the wrapping function and > >> th

Re: Passing a hidden argument in a dedicated register

2024-12-23 Thread Florian Weimer via Gcc
* Alexander Monakov: > On Mon, 16 Dec 2024, Florian Weimer via Gcc wrote: > >> I would like to provide a facility to create wrapper functions without >> lots of argument shuffling. To achieve that, the wrapping function and >> the wrapped function should have the same prototype. There will be a

Re: Passing a hidden argument in a dedicated register

2024-12-16 Thread Michael Clark via Gcc
> On 17 Dec 2024, at 5:44 AM, Alexander Monakov wrote: > >  >> On Mon, 16 Dec 2024, Florian Weimer via Gcc wrote: >> >> I would like to provide a facility to create wrapper functions without >> lots of argument shuffling. To achieve that, the wrapping function and >> the wrapped function sho

Re: Passing a hidden argument in a dedicated register

2024-12-16 Thread Alexander Monakov
On Mon, 16 Dec 2024, Florian Weimer via Gcc wrote: > I would like to provide a facility to create wrapper functions without > lots of argument shuffling. To achieve that, the wrapping function and > the wrapped function should have the same prototype. There will be a > trampoline that puts add

Passing a hidden argument in a dedicated register

2024-12-16 Thread Florian Weimer via Gcc
I would like to provide a facility to create wrapper functions without lots of argument shuffling. To achieve that, the wrapping function and the wrapped function should have the same prototype. There will be a trampoline that puts additional data somewhere (possibly including the address of the