This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFC patch] libffi support for FreeBSD/PowerPC
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Andreas Tobler <toa at pop dot agri dot ch>
- Cc: Java Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Jul 2005 14:46:33 -0400
- Subject: Re: [RFC patch] libffi support for FreeBSD/PowerPC
- References: <42D8FE32.30403@pop.agri.ch>
+ Since the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4
^ Because
+ # Extract the size of the return type for small structures.
+ # Then calculate (4 - size) and multiply the result by 8.
+ # This gives the value needed for the shift operation below.
+ # This part is only needed for FFI_SYSV and small structures.
+ addic %r5,%r3,-(FFI_SYSV_TYPE_SMALL_STRUCT)
+ cmpwi cr0,%r5,4
+ ble cr0,.Lnext
+ addic %r5,%r5,-4
+.Lnext:
+ addic %r5,%r5,-4
+ neg %r5,%r5
+ slwi %r5,%r5,3
This assembly code should use "addi", not "addic" because %r0 and
carry are not referenced.
+# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct.
+.Lret_type21:
+# fall through.
+ nop
+ nop
+ nop
+ nop
This case appears to be indented one extra space. Please align
properly.
Okay with those changes.
Thanks, David