public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* m68k patch for m68000
@ 2013-02-27 11:03 Alan Hourihane
  2013-03-10 23:42 ` Alan Hourihane
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Hourihane @ 2013-02-27 11:03 UTC (permalink / raw)
  To: libffi-discuss

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Hi Anthony,

I missed the 3.0.12 release and this patch for m68000 machines is 
required as it doesn't support the extb instruction, so we have to do it 
with two shift operations.

Thanks,

Alan.



[-- Attachment #2: m68k.patch --]
[-- Type: text/x-patch, Size: 886 bytes --]

diff --git a/src/m68k/sysv.S b/src/m68k/sysv.S
index 9504c6a..ec2b14f 100644
--- a/src/m68k/sysv.S
+++ b/src/m68k/sysv.S
@@ -176,7 +176,13 @@ retstruct2:
 retsint8:
 	btst	#8,%d2
 	jbeq	retsint16
+	| NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+	ext.w	%d0
+	ext.l	%d0
+#else
 	extb.l	%d0
+#endif
 	move.l	%d0,(%a1)
 	jbra	epilogue
 
@@ -279,7 +285,13 @@ CALLFUNC(ffi_closure_SYSV):
 	jra	.Lcls_epilogue
 .Lcls_ret_sint8:
 	move.l	(%a0),%d0
+	| NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+	ext.w	%d0
+	ext.l	%d0
+#else
 	extb.l	%d0
+#endif
 	jra	.Lcls_epilogue
 1:
 	| CIF_FLAGS_SINT16

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

* Re: m68k patch for m68000
  2013-02-27 11:03 m68k patch for m68000 Alan Hourihane
@ 2013-03-10 23:42 ` Alan Hourihane
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Hourihane @ 2013-03-10 23:42 UTC (permalink / raw)
  To: libffi-discuss

On 02/27/13 11:03, Alan Hourihane wrote:
> Hi Anthony,
>
> I missed the 3.0.12 release and this patch for m68000 machines is 
> required as it doesn't support the extb instruction, so we have to do 
> it with two shift operations.
>

Hi Anthony,

Just a ping, as I haven't seen this get committed yet.

Thanks,

Alan.

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

end of thread, other threads:[~2013-03-10 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 11:03 m68k patch for m68000 Alan Hourihane
2013-03-10 23:42 ` Alan Hourihane

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).