[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] MiNTLib fix for GCC 4.7.1



Hello.

I have just made some tests with GCC 4.7.1, it looks promising.

The MiNTLib does not compile because the assembler register constraints in ROL macros were not correctly specified. Here is the fix.

rol.patch
Fix compilation for GCC 4.7.1. Contributed by Vincent Riviere.

Please commit.

BTW: While the MiNTLib compiles fine after that, there are some warnings.

--
Vincent Rivière
diff -x CVS -aurN mintlib.orig/include/macros.h mintlib/include/macros.h
--- mintlib.orig/include/macros.h	2009-05-18 22:32:10.234375000 +0200
+++ mintlib/include/macros.h	2012-06-16 09:14:15.062500000 +0200
@@ -67,62 +67,62 @@
 #if defined(__GNUC__) && !defined(__mcoldfire__)
 #define ROLL(offset, x)	\
 ({ unsigned long __arg = (x);	\
-    __asm__ ("roll %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("roll %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define RORL(offset, x)	\
 ({ unsigned long __arg = (x);	\
-    __asm__ ("rorl %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("rorl %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define ROLW(offset, x)	\
 ({ unsigned short __arg = (x);	\
-    __asm__ ("roll %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("roll %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define RORW(offset, x)	\
 ({ unsigned short __arg = (x);	\
-    __asm__ ("rorl %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("rorl %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define ROLB(offset, x)	\
 ({ unsigned char __arg = (x);	\
-    __asm__ ("roll %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("roll %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define RORB(offset, x)	\
 ({ unsigned char __arg = (x);	\
-    __asm__ ("rorl %2,%1": "=r" (__arg) : "0" (__arg), "d" (offset)); \
+    __asm__ ("rorl %2,%1": "=d" (__arg) : "0" (__arg), "d" (offset)); \
     __arg; })
 
 #define ROLL1(x)	\
 ({ unsigned long __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #define RORL1(x)	\
 ({ unsigned long __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #define ROLW1(x)	\
 ({ unsigned short __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #define RORW1(x)	\
 ({ unsigned short __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #define ROLB1(x)	\
 ({ unsigned char __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #define RORB1(x)	\
 ({ unsigned char __arg = (x);	\
-    __asm__ ("roll #1,%1": "=r" (__arg) : "0" (__arg)); \
+    __asm__ ("roll #1,%1": "=d" (__arg) : "0" (__arg)); \
     __arg; })
 
 #endif