Fix for m68000 systems
authorAnthony Green <green@moxielogic.com>
Sat, 16 Mar 2013 12:01:19 +0000 (08:01 -0400)
committerAnthony Green <green@moxielogic.com>
Sat, 16 Mar 2013 12:12:19 +0000 (08:12 -0400)
ChangeLog
README
src/m68k/sysv.S

index 525e5185f89c6faee3b4127fac5d5a45b9257a27..b4273ded5a44039582b602de1e053655895f8380 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-16  Alan Hourihane  <alanh@fairlite.co.uk>
+
+       * src/m68k/sysv.S (epilogue): Don't user extb instruction on
+       m680000 machines.
+
 2013-03-16  Alex Gaynor <alex.gaynor@gmail.com>
 
        * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack.
diff --git a/README b/README
index 250c515f2db313536fe15429e6c3d4ba7512643f..fd5e6b42105f394ac466451bcb53cebdd0b73d87 100644 (file)
--- a/README
+++ b/README
@@ -168,6 +168,7 @@ See the ChangeLog files for details.
        Add Meta support.
        Add missing Moxie bits.
        Fix stack alignment bug on 32-bit x86.
+       Build fix for m68000 targets.
 
 3.0.12 Feb-11-13
         Add Moxie support.
index 9504c6a6325b7a85cd8d400a95054a3a625bf32e..ec2b14f3d9817daf396b5dcb4cd80fc5c48d51d4 100644 (file)
@@ -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