aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2012-11-22 05:58:22 -0500
committerRalf Baechle <ralf@linux-mips.org>2012-11-23 12:57:17 -0500
commita3cea9894157c20a5b1ec08b7e0b5f2019740c10 (patch)
treea1d319be7afd92637f89c5e6cbc2865b5cf908f6 /lib
parentf93a1a00f2bd550f86fd1a9f83c493755aecd15f (diff)
MPI: Fix compilation on MIPS with GCC 4.4 and newer
Since 4.4 GCC on MIPS no longer recognizes the "h" constraint, leading to this build failure: CC lib/mpi/generic_mpih-mul1.o lib/mpi/generic_mpih-mul1.c: In function 'mpihelp_mul_1': lib/mpi/generic_mpih-mul1.c:50:3: error: impossible constraint in 'asm' This patch updates MPI with the latest umul_ppm implementations for MIPS. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Cc: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Cc: James Morris <jmorris@namei.org> Patchwork: https://patchwork.linux-mips.org/patch/4612/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/mpi/longlong.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index 678ce4f1e124..095ab157a521 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -641,7 +641,14 @@ do { \
641 ************** MIPS ***************** 641 ************** MIPS *****************
642 ***************************************/ 642 ***************************************/
643#if defined(__mips__) && W_TYPE_SIZE == 32 643#if defined(__mips__) && W_TYPE_SIZE == 32
644#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 644#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
645#define umul_ppmm(w1, w0, u, v) \
646do { \
647 UDItype __ll = (UDItype)(u) * (v); \
648 w1 = __ll >> 32; \
649 w0 = __ll; \
650} while (0)
651#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
645#define umul_ppmm(w1, w0, u, v) \ 652#define umul_ppmm(w1, w0, u, v) \
646 __asm__ ("multu %2,%3" \ 653 __asm__ ("multu %2,%3" \
647 : "=l" ((USItype)(w0)), \ 654 : "=l" ((USItype)(w0)), \
@@ -666,7 +673,15 @@ do { \
666 ************** MIPS/64 ************** 673 ************** MIPS/64 **************
667 ***************************************/ 674 ***************************************/
668#if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64 675#if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64
669#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 676#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
677#define umul_ppmm(w1, w0, u, v) \
678do { \
679 typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
680 __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
681 w1 = __ll >> 64; \
682 w0 = __ll; \
683} while (0)
684#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
670#define umul_ppmm(w1, w0, u, v) \ 685#define umul_ppmm(w1, w0, u, v) \
671 __asm__ ("dmultu %2,%3" \ 686 __asm__ ("dmultu %2,%3" \
672 : "=l" ((UDItype)(w0)), \ 687 : "=l" ((UDItype)(w0)), \