Przeglądaj źródła

* as Coldfire does not support ADD.W save the (original) lower word and restore it after D0 is swapped back (I hope the algorithm still works then O.o)

git-svn-id: trunk@38044 -
svenbarth 7 lat temu
rodzic
commit
bd57af5b19
1 zmienionych plików z 20 dodań i 2 usunięć
  1. 20 2
      rtl/m68k/int64p.inc

+ 20 - 2
rtl/m68k/int64p.inc

@@ -27,7 +27,7 @@ asm
     movem.l  d2-d5,-(sp)
 {$else}
     tst.l    -(sp)
-    movem.l  d2-d5,(sp)
+    movem.l  d2-d6,(sp)
 {$endif}
     move.l   d0,d5
 
@@ -55,11 +55,25 @@ asm
     mulu.w   d4,d2
     mulu.w   d4,d3
 
+{$ifdef CPUCOLDFIRE}
+    { backup lo value of d0 }
+    clr.l    d6
+    move.w   d0,d6
+    clr.w    d0
+{$endif}
     swap     d0
     clr.l    d4
+{$ifndef CPUCOLDFIRE}
     add.w    d1,d0
+{$else}
+    add.l    d1,d0
+{$endif}
     addx.l   d4,d3
+{$ifndef CPUCOLDFIRE}
     add.w    d2,d0
+{$else}
+    add.l    d2,d0
+{$endif}
     addx.l   d4,d3
 
     clr.w    d1
@@ -69,6 +83,10 @@ asm
 
     add.l    d3,d1
     swap     d0
+{$ifdef CPUCOLDFIRE}
+    { restore lo value of d0 }
+    move.w   d6,d0
+{$endif}
     add.l    d2,d1
 
     tst.l    d5
@@ -85,7 +103,7 @@ asm
     move.l   d0,d2
     move.l   d1,d0
     move.l   d2,d1
-    movem.l  (sp),d2-d5
+    movem.l  (sp),d2-d6
     tst.l    (sp)+
 {$endif}
     rts