Re: Build problem with m68K architecture

Malcolm Wallace <[email protected]> Thu, 6 Feb 2003 11:26:11 +0000
Newsgroups gmane.comp.lang.haskell.nhc.bugs
Organization Dept of Computer Science, University of York
Message-ID <[email protected]>
Brent Fulgham <[email protected]> writes:

> The m68K architecture (pre-powerpc apple computers) won't build.  This
> problem has been around since nhc98-1.10:
> 
> > In function `_mpn_div': mpn_div.c:136: `asm' operand requires impossible
> >                                        reload

Try this patch.  I don't know enough about m68k assembler to be
certain that it will fix the problem, but it might be a useful start.

Regards,
    Malcolm
patch-m68000 (text/plain, 1.6 KB)
diff -u -r1.2 asmlong.h
--- src/runtime/Integer/asmlong.h	2000/02/25 14:10:57	1.2
+++ src/runtime/Integer/asmlong.h	2003/02/06 11:21:55
@@ -233,23 +233,21 @@
 
 #if defined (__mc68000__)
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("add%.l %5,%1
-	addx%.l %3,%0"							\
-	   : "=d,d" ((unsigned long int)(sh)),				\
-	     "=&d,m" ((unsigned long int)(sl))				\
-	   : "%0,0" ((unsigned long int)(ah)),				\
-	     "d,d" ((unsigned long int)(bh)),				\
-	     "%1,1" ((unsigned long int)(al)),				\
-	     "g,d" ((unsigned long int)(bl)))
+  __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0"				\
+	   : "=d" ((unsigned long int)(sh)),				\
+	     "=&d" ((unsigned long int)(sl))				\
+	   : "%0" ((unsigned long int)(ah)),				\
+	     "d" ((unsigned long int)(bh)),				\
+	     "%1" ((unsigned long int)(al)),				\
+	     "g" ((unsigned long int)(bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("sub%.l %5,%1
-	subx%.l %3,%0"							\
-	   : "=d,d" ((unsigned long int)(sh)),				\
-	     "=&d,m" ((unsigned long int)(sl))				\
-	   : "0,0" ((unsigned long int)(ah)),				\
-	     "d,d" ((unsigned long int)(bh)),				\
-	     "1,1" ((unsigned long int)(al)),				\
-	     "g,d" ((unsigned long int)(bl)))
+  __asm__ ("sub%.l %5,%1\n\tsubx%.l %3,%0"				\
+	   : "=d" ((unsigned long int)(sh)),				\
+	     "=&d" ((unsigned long int)(sl))				\
+	   : "0" ((unsigned long int)(ah)),				\
+	     "d" ((unsigned long int)(bh)),				\
+	     "1" ((unsigned long int)(al)),				\
+	     "g" ((unsigned long int)(bl)))
 #if defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mulu%.l %3,%1:%0"						\