[svn] GnuPG - r5466 - branches/STABLE-BRANCH-1-4/mpi
svn author wk
cvs at cvs.gnupg.org
Fri Oct 22 09:35:30 CEST 2010
Author: wk
Date: 2010-10-22 09:35:30 +0200 (Fri, 22 Oct 2010)
New Revision: 5466
Modified:
branches/STABLE-BRANCH-1-4/mpi/ChangeLog
branches/STABLE-BRANCH-1-4/mpi/longlong.h
Log:
mips fixes
Modified: branches/STABLE-BRANCH-1-4/mpi/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/mpi/ChangeLog 2010-10-21 10:25:03 UTC (rev 5465)
+++ branches/STABLE-BRANCH-1-4/mpi/ChangeLog 2010-10-22 07:35:30 UTC (rev 5466)
@@ -1,3 +1,8 @@
+2010-10-22 Jason Woodward <jason.woodward at timesys.com> (wk)
+
+ * longlong.h (umul_ppmm) [mips32]: Fix typo.
+ (umul_ppmm) [mips64]: Don't use =h with gcc >= 4.4.
+
2010-06-01 Werner Koch <wk at g10code.com>
* longlong.h (umul_ppmm) <__mips__>: Add code for gcc 4.4. This
Modified: branches/STABLE-BRANCH-1-4/mpi/longlong.h
===================================================================
--- branches/STABLE-BRANCH-1-4/mpi/longlong.h 2010-10-21 10:25:03 UTC (rev 5465)
+++ branches/STABLE-BRANCH-1-4/mpi/longlong.h 2010-10-22 07:35:30 UTC (rev 5466)
@@ -710,7 +710,7 @@
************** MIPS *****************
***************************************/
#if defined (__mips__) && W_TYPE_SIZE == 32
-#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR >= 4 )
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
#define umul_ppmm(w1, w0, u, v) \
do { \
UDItype __ll = (UDItype)(u) * (v); \
@@ -727,8 +727,8 @@
#else
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("multu %2,%3 \n" \
- "mflo %0 \n" \
- "mfhi %1" \
+ "mflo %0 \n" \
+ "mfhi %1" \
: "=d" ((USItype)(w0)), \
"=d" ((USItype)(w1)) \
: "d" ((USItype)(u)), \
@@ -742,25 +742,33 @@
************** MIPS/64 **************
***************************************/
#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
-#define umul_ppmm(w1, w0, u, v) \
- __asm__ ("dmultu %2,%3" \
- : "=l" ((UDItype)(w0)), \
- "=h" ((UDItype)(w1)) \
- : "d" ((UDItype)(u)), \
- "d" ((UDItype)(v)))
-#else
-#define umul_ppmm(w1, w0, u, v) \
- __asm__ ("dmultu %2,%3 \n" \
- "mflo %0 \n" \
- "mfhi %1" \
- : "=d" ((UDItype)(w0)), \
- "=d" ((UDItype)(w1)) \
- : "d" ((UDItype)(u)), \
- "d" ((UDItype)(v)))
-#endif
-#define UMUL_TIME 20
-#define UDIV_TIME 140
+# if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+# define umul_ppmm(w1, w0, u, v) \
+ do { \
+ typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
+ __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
+ w1 = __ll >> 64; \
+ w0 = __ll; \
+ } while (0)
+# elif if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+# define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3" \
+ : "=l" ((UDItype)(w0)), \
+ "=h" ((UDItype)(w1)) \
+ : "d" ((UDItype)(u)), \
+ "d" ((UDItype)(v)))
+# else
+# define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3 \n" \
+ "mflo %0 \n" \
+ "mfhi %1" \
+ : "=d" ((UDItype)(w0)), \
+ "=d" ((UDItype)(w1)) \
+ : "d" ((UDItype)(u)), \
+ "d" ((UDItype)(v)))
+# endif
+# define UMUL_TIME 20
+# define UDIV_TIME 140
#endif /* __mips__ */
More information about the Gnupg-commits
mailing list