From d6825dcfed19d2639b304a96d8cec1cabb040783 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 13 Dec 2011 09:51:43 -0800 Subject: Patch to shrink mpi-int to three words on 32 bit platforms, so that obj_t stays four pointers wide. * mpi-patches/series: New patch added. * mpi-patches/shrink-mpi-int: New file. --- ChangeLog | 9 +++++++++ mpi-patches/series | 1 + mpi-patches/shrink-mpi-int | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 mpi-patches/shrink-mpi-int diff --git a/ChangeLog b/ChangeLog index efd15251..8ca0d8a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-12-13 Kaz Kylheku + + Patch to shrink mpi-int to three words on 32 bit platforms, + so that obj_t stays four pointers wide. + + * mpi-patches/series: New patch added. + + * mpi-patches/shrink-mpi-int: New file. + 2011-12-12 Kaz Kylheku * mpi-patches/bit-search-optimizations (s_highest_bit): Added static diff --git a/mpi-patches/series b/mpi-patches/series index d12f15d1..311d7fe5 100644 --- a/mpi-patches/series +++ b/mpi-patches/series @@ -10,3 +10,4 @@ mpi-set-mpi-word mpi-set-double-intptr fix-bad-shifts bit-search-optimizations +shrink-mpi-int diff --git a/mpi-patches/shrink-mpi-int b/mpi-patches/shrink-mpi-int new file mode 100644 index 00000000..b1b03aa9 --- /dev/null +++ b/mpi-patches/shrink-mpi-int @@ -0,0 +1,20 @@ +Index: mpi-1.8.6/mpi.h +=================================================================== +--- mpi-1.8.6.orig/mpi.h 2011-12-13 09:35:31.000000000 -0800 ++++ mpi-1.8.6/mpi.h 2011-12-13 09:40:01.000000000 -0800 +@@ -72,8 +72,13 @@ + #define MAX_RADIX 64 + + typedef struct { +- mp_sign sign; /* sign of this quantity */ +- mp_size alloc; /* how many digits allocated */ ++#if SIZEOF_INT >= SIZEOF_PTR ++ unsigned int sign : 1; /* sign of this quantity */ ++ unsigned int alloc : sizeof(int) - 1; /* how many digits allocated */ ++#else ++ mp_sign sign; ++ mp_size alloc; ++#endif + mp_size used; /* how many digits used */ + mp_digit *dp; /* the digits themselves */ + } mp_int; -- cgit v1.2.3