lightning
[Top][All Lists]
Advanced

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

Re: [PATCH] ppc: Fix 'calli' when floating-point arguments are passed


From: Paulo César Pereira de Andrade
Subject: Re: [PATCH] ppc: Fix 'calli' when floating-point arguments are passed
Date: Tue, 23 Aug 2022 14:28:18 -0300

Em ter., 23 de ago. de 2022 às 13:48, Paul Cercueil
<paul@crapouillou.net> escreveu:
>
> [...]
>
> >>  qemu: uncaught target signal 4 (Illegal instruction) - core dumped
> >
> > https://www.ibm.com/docs/en/aix/7.1?topic=set-fsqrts-floating-square-root-single-instruction
> > says:
> > """
> > Implementation
> >
> > This instruction is optionally defined for PowerPC® implementations.
> > Using it on an implementation that does not support this instruction
> > will cause the system illegal instruction error handler to be invoked.
> >
> > This instruction is an optional instruction of the PowerPC®
> > architecture and may not be implemented in all machines.
> > """
> >   Can you see what /proc/cpuinfo says? Maybe if we know it is
> > not available, do a FMR, FSQRT, FRSP (extr_f_d, sqrtr_d, extr_d_f).
>
> Ok, if I replace the FSQRTS with a simple movr_f() then I don't get an
> illegal instruction anymore, so I believe qemu-user doesn't have that
> instruction by default.
>
> Note that it doesn't have FSQRT either.
>
> I think we can just ignore the sqrt check then.

  Maybe qemu-user can be configured to emulate a newer cpu.

  Checking assembly of libm on a test powerpc, it uses fsqrts
in libm.

> About the "call" check, I didn't debug it yet, but it may be related to
> calling "near" code as well. I had to use the following temporary
> workaround in my code to avoid crashes:
> https://github.com/pcercuei/lightrec/blob/master/emitter.c#L35-L47

  This is strange. check/*.tst is full of forward and backward jumps.
Not just call.tst has them. But call.tst has a few forward/backward
tests of calls and jumps. Unless the can_sign_extend_jump_p() macro
has some bug in the displacement test, and  was never experienced
in the tests.

> Cheers,
> -Paul
>
>



reply via email to

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