patches/mpfr/2.4.2/110-longlong.h.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
     1 diff -Naurd mpfr-2.4.2-a/PATCHES mpfr-2.4.2-b/PATCHES
     2 --- mpfr-2.4.2-a/PATCHES	2009-12-18 12:03:30.000000000 +0000
     3 +++ mpfr-2.4.2-b/PATCHES	2009-12-18 12:05:19.000000000 +0000
     4 @@ -0,0 +1 @@
     5 +longlong.h
     6 diff -Naurd mpfr-2.4.2-a/VERSION mpfr-2.4.2-b/VERSION
     7 --- mpfr-2.4.2-a/VERSION	2009-12-07 13:37:12.000000000 +0000
     8 +++ mpfr-2.4.2-b/VERSION	2009-12-18 12:05:09.000000000 +0000
     9 @@ -1 +1 @@
    10 -2.4.2-p1
    11 +2.4.2-p2
    12 diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h
    13 --- mpfr-2.4.2-a/mpfr-longlong.h	2009-11-30 02:43:08.000000000 +0000
    14 +++ mpfr-2.4.2-b/mpfr-longlong.h	2009-12-18 12:04:29.000000000 +0000
    15 @@ -1011,7 +1011,15 @@
    16  #endif /* __m88000__ */
    17  
    18  #if defined (__mips) && W_TYPE_SIZE == 32
    19 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
    20 +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
    21 +#define umul_ppmm(w1, w0, u, v) \
    22 +  do {									\
    23 +    UDItype _r;							\
    24 +    _r = (UDItype) u * v;						\
    25 +    (w1) = _r >> 32;							\
    26 +    (w0) = (USItype) _r;						\
    27 +  } while (0)
    28 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
    29  #define umul_ppmm(w1, w0, u, v) \
    30    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    31  #else
    32 @@ -1024,7 +1032,16 @@
    33  #endif /* __mips */
    34  
    35  #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
    36 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
    37 +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
    38 +typedef unsigned int UTItype __attribute__ ((mode (TI)));
    39 +#define umul_ppmm(w1, w0, u, v) \
    40 +  do {									\
    41 +    UTItype _r;							\
    42 +    _r = (UTItype) u * v;						\
    43 +    (w1) = _r >> 64;							\
    44 +    (w0) = (UDItype) _r;						\
    45 +  } while (0)
    46 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
    47  #define umul_ppmm(w1, w0, u, v) \
    48    __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    49  #else
    50 diff -Naurd mpfr-2.4.2-a/mpfr.h mpfr-2.4.2-b/mpfr.h
    51 --- mpfr-2.4.2-a/mpfr.h	2009-12-07 13:37:12.000000000 +0000
    52 +++ mpfr-2.4.2-b/mpfr.h	2009-12-18 12:05:09.000000000 +0000
    53 @@ -27,7 +27,7 @@
    54  #define MPFR_VERSION_MAJOR 2
    55  #define MPFR_VERSION_MINOR 4
    56  #define MPFR_VERSION_PATCHLEVEL 2
    57 -#define MPFR_VERSION_STRING "2.4.2-p1"
    58 +#define MPFR_VERSION_STRING "2.4.2-p2"
    59  
    60  /* Macros dealing with MPFR VERSION */
    61  #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
    62 diff -Naurd mpfr-2.4.2-a/version.c mpfr-2.4.2-b/version.c
    63 --- mpfr-2.4.2-a/version.c	2009-12-07 13:37:12.000000000 +0000
    64 +++ mpfr-2.4.2-b/version.c	2009-12-18 12:05:09.000000000 +0000
    65 @@ -25,5 +25,5 @@
    66  const char *
    67  mpfr_get_version (void)
    68  {
    69 -  return "2.4.2-p1";
    70 +  return "2.4.2-p2";
    71  }