public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libffi/31937]  New: libffi doesn't support ppc without FPU
@ 2007-05-15 15:39 patrick dot olinet at gmail dot com
  2007-05-16 13:23 ` [Bug libffi/31937] " patrick dot olinet at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: patrick dot olinet at gmail dot com @ 2007-05-15 15:39 UTC (permalink / raw)
  To: gcc-bugs

PowerPC CPU without FPU (such as the PPC405EP) doesn't pass the libffi
testsuite. Most of the tests crash with an "illegal instruction" error message,
even those that don't manipulate double/float. For instance, it crashes with
the "cls_uint" test.

After investigating, I think the problem comes from the ppc assembly code from
the libffi/src/powerpc directory that includes FPU instructions not supported
by those CPU. In particular, the ppc_closure.S file contains "stfd" FPU
instructions that are supposed to save FPU registers and are always executed,
even if no fpu operation is to be performed.

If you don't need fpu support (as I do), a quick and dirty hack is to comment
out those "stfd" instructions from the ppc_closure.S file.

I guess the right way to fix it would be to use the soft-float system when no
FPU is present. But that's something I don't know how to do...

I've tried with gcc 3.4.3 and gcc 4.1.0, but I guess all versions are affected.


-- 
           Summary: libffi doesn't support ppc without FPU
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: patrick dot olinet at gmail dot com
 GCC build triplet: i686-linux-gnu
  GCC host triplet: powerpc-405-linux-gnu
GCC target triplet: powerpc-405-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
@ 2007-05-16 13:23 ` patrick dot olinet at gmail dot com
  2007-11-02 22:02 ` andreast at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: patrick dot olinet at gmail dot com @ 2007-05-16 13:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from patrick dot olinet at gmail dot com  2007-05-16 14:23 -------

Notice that this bug prevents loading and running java bytecode from a native
code binary compiled with gcj. I guess it relies on libffi to call the methods
of the bytecode.

This java problem is what I've encountered first before investigating and
finding out that it all comes from libfii.


-- 

patrick dot olinet at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |patrick dot olinet at gmail
                   |                            |dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
  2007-05-16 13:23 ` [Bug libffi/31937] " patrick dot olinet at gmail dot com
@ 2007-11-02 22:02 ` andreast at gcc dot gnu dot org
  2007-11-06 22:55 ` andreast at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-11-02 22:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from andreast at gcc dot gnu dot org  2007-11-02 22:01 -------
Working on support for.


-- 

andreast at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |andreast at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-02 22:01:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
  2007-05-16 13:23 ` [Bug libffi/31937] " patrick dot olinet at gmail dot com
  2007-11-02 22:02 ` andreast at gcc dot gnu dot org
@ 2007-11-06 22:55 ` andreast at gcc dot gnu dot org
  2007-11-08 19:34 ` andreast at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-11-06 22:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from andreast at gcc dot gnu dot org  2007-11-06 22:55 -------
Patch is posted here:
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00286.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
                   ` (2 preceding siblings ...)
  2007-11-06 22:55 ` andreast at gcc dot gnu dot org
@ 2007-11-08 19:34 ` andreast at gcc dot gnu dot org
  2007-11-21 22:13 ` andreast at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-11-08 19:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from andreast at gcc dot gnu dot org  2007-11-08 19:34 -------
The mentioned patch does not work properly, it only handles soft-float when
no-long-double-128 is used.
Working on a better one which should support both, 'double == long double' and
long double == 128.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
                   ` (3 preceding siblings ...)
  2007-11-08 19:34 ` andreast at gcc dot gnu dot org
@ 2007-11-21 22:13 ` andreast at gcc dot gnu dot org
  2007-11-21 22:14 ` andreast at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-11-21 22:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from andreast at gcc dot gnu dot org  2007-11-21 22:13 -------
New patch here: http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01128.html


-- 

andreast at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|andreast at gcc dot gnu dot |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
                   ` (4 preceding siblings ...)
  2007-11-21 22:13 ` andreast at gcc dot gnu dot org
@ 2007-11-21 22:14 ` andreast at gcc dot gnu dot org
  2007-12-01 21:00 ` andreast at gcc dot gnu dot org
  2007-12-01 21:02 ` andreast at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-11-21 22:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from andreast at gcc dot gnu dot org  2007-11-21 22:14 -------
Buh, reassigng.


-- 

andreast at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |andreast at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-11-02 22:01:59         |2007-11-21 22:14:29
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
                   ` (5 preceding siblings ...)
  2007-11-21 22:14 ` andreast at gcc dot gnu dot org
@ 2007-12-01 21:00 ` andreast at gcc dot gnu dot org
  2007-12-01 21:02 ` andreast at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-12-01 21:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from andreast at gcc dot gnu dot org  2007-12-01 21:00 -------
Subject: Bug 31937

Author: andreast
Date: Sat Dec  1 21:00:04 2007
New Revision: 130559

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130559
Log:
2007-12-01  Andreas Tobler  <a.tobler@schweiz.org>

        PR libffi/31937
        * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT.
        Add local FFI_TYPE_UINT128 to handle soft-float long-double-128.
        * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and
        set the NUM_FPR_ARG_REGISTERS according to.
        Add support for potential soft-float support under hard-float
        architecture.
        (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of
        FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according
        to the FFI_LINUX_SOFT_FLOAT ABI.
        (ffi_prep_cif_machdep): Likewise.
        (ffi_closure_helper_SYSV): Likewise.
        * src/powerpc/ppc_closure.S: Make sure not to store float/double
        on archs where __NO_FPRS__ is true.
        Add FFI_TYPE_UINT128 support.
        * src/powerpc/sysv.S: Add support for soft-float long-double-128.
        Adjust copyright notice.

Modified:
    trunk/libffi/ChangeLog
    trunk/libffi/src/powerpc/ffi.c
    trunk/libffi/src/powerpc/ffitarget.h
    trunk/libffi/src/powerpc/ppc_closure.S
    trunk/libffi/src/powerpc/sysv.S


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libffi/31937] libffi doesn't support ppc without FPU
  2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
                   ` (6 preceding siblings ...)
  2007-12-01 21:00 ` andreast at gcc dot gnu dot org
@ 2007-12-01 21:02 ` andreast at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu dot org @ 2007-12-01 21:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from andreast at gcc dot gnu dot org  2007-12-01 21:02 -------
Implemented. Hopefully it will be of some use to others :)


-- 

andreast at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31937


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-12-01 21:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-15 15:39 [Bug libffi/31937] New: libffi doesn't support ppc without FPU patrick dot olinet at gmail dot com
2007-05-16 13:23 ` [Bug libffi/31937] " patrick dot olinet at gmail dot com
2007-11-02 22:02 ` andreast at gcc dot gnu dot org
2007-11-06 22:55 ` andreast at gcc dot gnu dot org
2007-11-08 19:34 ` andreast at gcc dot gnu dot org
2007-11-21 22:13 ` andreast at gcc dot gnu dot org
2007-11-21 22:14 ` andreast at gcc dot gnu dot org
2007-12-01 21:00 ` andreast at gcc dot gnu dot org
2007-12-01 21:02 ` andreast at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).