This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libffi & powerpc


Finally, I've tried it the dirty way, ie by commenting out all the
"stfd" instructions at the beginning of the ppc_closure.S file and
things seem to work !!!

"stfd" are used to save fpu registers and were always executed, even
if no float/double arguments were involved in the call and if no fpu
is present.

Of course, I'm still unable to use float/double with the libffi but I
don't need it so I don't think I'm going to dig into this. As far as I
understand, calls to the soft float ABI would be required to fix this.

What worries me a bit is that "stfd" instructions are used to save fpu
registers states before the call (it's my guess) and I would expect
them to be restored afterwards, probably with "lfd" assembly
instructions (that I would need to comment out as well). But I can't
see such instructions...

Any thoughts about that ?

And should I report a new bug for this libffi/powerpc problem ?

And thanks again to all of you for your help.

Patrick


On 5/14/07, Mike Stump <mrs@apple.com> wrote:
On May 14, 2007, at 8:46 AM, Patrick Olinet wrote:
> Running with gdb, it looks like the problem comes from the
> ppc_closure.S file of the libffi/src/powerpc directory, at line 32 :

Maybe something like:

#ifndef _SOFT_FLOAT
> stfd %f1, 48(%r1)
#endif

but then, you might have to have something like:

#define CPP_SPEC \
"%{msoft-float: -D_SOFT_FLOAT} \

(picked at random from lynx.h) in the .h file for your port.

:-) But I'm sure there would be more work to do.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]