[vlc-devel] [PATCH] gmp: fix compilation on mipsel
Rafaël Carré
funman at videolan.org
Tue Aug 13 11:06:53 CEST 2013
Hello,
Le 12/08/2013 23:34, Edward Wang a écrit :
> GCC 4.4+ no longer accepts the "=h" constraint.
> ---
> contrib/src/gmp/mips.diff | 23 +++++++++++++++++++++++
> contrib/src/gmp/rules.mak | 1 +
> 2 files changed, 24 insertions(+)
> create mode 100644 contrib/src/gmp/mips.diff
>
> diff --git a/contrib/src/gmp/mips.diff b/contrib/src/gmp/mips.diff
> new file mode 100644
> index 0000000..ee043da
> --- /dev/null
> +++ b/contrib/src/gmp/mips.diff
> @@ -0,0 +1,23 @@
> +--- gmp/longlong.h 2006-03-14 10:57:54.000000000 -0500
> ++++ gmp/longlong.h 2013-08-12 12:03:50.080931954 -0400
> +@@ -1011,7 +1011,19 @@
> + #endif /* __m88000__ */
> +
> + #if defined (__mips) && W_TYPE_SIZE == 32
> +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
> ++
> ++#define GCC_VERSION (__GNUC__ * 10000 \
> ++ + __GNUC_MINOR__ * 100 \
> ++ + __GNUC_PATCHLEVEL__)
> ++
> ++#if GCC_VERSION >= 40400
> ++#define umul_ppmm(w1, w0, u, v) \
> ++ do { \
> ++ uint64_t res = u*v; \
> ++ w1 = res >> 32; \
> ++ w0 = res; \
> ++ } while(0);
Looks good, thanks
> ++#elif GCC_VERSION >= 20700 && GCC_VERSION < 40400
&& GCC_VERSION < 40400 is redundant with first #if
> + #define umul_ppmm(w1, w0, u, v) \
> + __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
> + #else
> diff --git a/contrib/src/gmp/rules.mak b/contrib/src/gmp/rules.mak
> index 63c4dfd..1b793cf 100644
> --- a/contrib/src/gmp/rules.mak
> +++ b/contrib/src/gmp/rules.mak
> @@ -15,6 +15,7 @@ gmp: gmp-$(GMP_VERSION).tar.bz2 .sum-gmp
> $(UNPACK)
> $(APPLY) $(SRC)/gmp/inline.diff
> $(APPLY) $(SRC)/gmp/arm.diff
> + $(APPLY) $(SRC)/gmp/mips.diff
> $(APPLY) $(SRC)/gmp/ansitest.diff
> $(APPLY) $(SRC)/gmp/ansi2knr.diff
> $(MOVE)
>
More information about the vlc-devel
mailing list