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: Paul Cercueil
Subject: Re: [PATCH] ppc: Fix 'calli' when floating-point arguments are passed
Date: Tue, 23 Aug 2022 18:48:30 +0200

[...]

 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.

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

Cheers,
-Paul





reply via email to

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