lightning
[Top][All Lists]
Advanced

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

Re: Check results on PowerPC


From: Paulo César Pereira de Andrade
Subject: Re: Check results on PowerPC
Date: Mon, 22 Aug 2022 13:10:27 -0300

Em seg., 22 de ago. de 2022 às 13:03, Paulo César Pereira de Andrade
<paulo.cesar.pereira.de.andrade@gmail.com> escreveu:

[...]

>   I did double check, and for calls to variadic functions, it should be
> doing both, set the fpr register and set the stack to match the variadic
> argument.
>   The only thing it is not doing, for _CALL_SYSV is to also set the
> integer register. But doing that would completely mess the call.
>
>   Se page 37 of refspecs.linux-foundation.org/elf/elfspec_ppc.pdf
>
>   About:
> """
> A caller of a function that takes a variable argument list shall set
> condition register bit 6 to 1 if it
> passes one or more arguments in the floating-point registers. It is
> strongly recommended that the
> caller set the bit to 0 otherwise, using the creqv 6, 6, 6 (set to 1)
> or crxor 6, 6, 6 (set to 0)
> instruction.
> """
>
>   What lightning does it to set the fpr registers and also set the stack
> offset to match a variadic call. Could add extra code for creqv or crxor,
> and still set the stack. But it already does both conventions to be certain...

  Oops, NVM, it already does:

"""
static void
_callr(jit_state_t *_jit, jit_int32_t r0
#  if _CALL_SYSV
       , jit_int32_t varargs
#  endif
       )
...
#    if _CALL_SYSV
    /* Tell double arguments were passed in registers. */
    if (varargs)
    CREQV(6, 6, 6);
#    endif
"""

since 
https://git.savannah.gnu.org/cgit/lightning.git/commit/?id=38e20cebf6430f48ebcd1c8b608b3329abc0221a
I do not remember where I did work on it, most likely it was
on a powerpc gcc farm host, compiling as a 32 bit library/binary.

Thanks,
Paulo



reply via email to

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