This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [Patch libffi, Darwin, PPC64] PR29152 (Darwin64 implementation), PR42387 (ppc va faults).
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: IainS <developer at sandoe-acoustics dot co dot uk>, Mike Stump <mrs at gcc dot gnu dot org>, Anthony Green <green at moxielogic dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libffi-discuss at sourceware dot org
- Date: Wed, 7 Mar 2012 20:52:55 -0500
- Subject: Re: [Patch libffi, Darwin, PPC64] PR29152 (Darwin64 implementation), PR42387 (ppc va faults).
- References: <CAGWvnynYYNRRawYrPXrSfLzrySSd+vi-bZuzgV=CKiXtGAcMBQ@mail.gmail.com>
This patch applies the same logic to aix_closure.S that was modified
in darwin_closure.S, returning from 100% failure to:
=== libffi Summary ===
# of expected passes 1638
# of unexpected failures 13
# of unsupported tests 55
* src/powerpc/aix_closure.S (ffi_closure_ASM): Load type
from ffi_type return type.
diff --git a/src/powerpc/aix_closure.S b/src/powerpc/aix_closure.S
index c906017..7c319a3 100644
--- a/src/powerpc/aix_closure.S
+++ b/src/powerpc/aix_closure.S
@@ -168,6 +168,7 @@ ffi_closure_ASM:
/* look up the proper starting point in table */
/* by using return type as offset */
ld r4, LC..60(2) /* get address of jump table */
+ lhz r3, 10(r3)
sldi r3, r3, 4 /* now multiply return type by 16 */
ld r0, 240+16(r1) /* load return address */
add r3, r3, r4 /* add contents of table to table address */
@@ -340,6 +341,7 @@ L..finish:
/* look up the proper starting point in table */
/* by using return type as offset */
lwz r4, LC..60(2) /* get address of jump table */
+ lhz r3, 6(r3)
slwi r3, r3, 4 /* now multiply return type by 4 */
lwz r0, 176+8(r1) /* load return address */
add r3, r3, r4 /* add contents of table to table address */