This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: [RFC patch] libffi support for FreeBSD/PowerPC


+     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


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