[RFC patch] libffi support for FreeBSD/PowerPC

David Edelsohn dje@watson.ibm.com
Tue Jul 19 18:46:00 GMT 2005


+     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



More information about the Java-patches mailing list