[PATCH 0/4] s390 improvements
Ulrich Weigand
uweigand@de.ibm.com
Fri Dec 19 17:08:00 GMT 2014
Richard Henderson wrote:
> On 12/19/2014 10:14 AM, Ulrich Weigand wrote:
> > In the end, it's probably OK for low-level code like libffi to make certain
> > assumptions on the behavior of the toolchain. I'm not quite sure whether
> > this actually gets us any significant benefit in this case. Does it really
> > matter whether ffi_prep_args is called from ffi_call_int vs. ffi_call_SYSV?
>
> I think it's the indirect call back to ffi_prep_args that I find ugliest,
> and for most targets, totally unnecessary.
Ah, OK. Yes, there's no need for the call to be indirect. I guess in the
original implementation on old S/390, there's no real difference between a
direct and an indirect call, but where we have brasl, we should really use
it and do a direct call.
> >> It's true that the load of %r15 is now a nop. It hadn't been at one point in
> >> my development; ffi_prep_args had had more than 5 parameters, and so there was
> >> extra stack allocated. I suppose if ffi_prep_args were inlined, one could be
> >> certain of this (since there will be no function calls) and document it as such.
> >
> > If we do use such tricks, this version may actually be preferable.
>
> I'll post that version shortly. If you still don't like it, then I'll
> try another tack whereby we simply avoid the indirect call.
I guess the new version is fine with me. Thanks for working on this!
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
More information about the Libffi-discuss
mailing list