Ticket #3800: gmp_StgArrWords.dpatch

File gmp_StgArrWords.dpatch, 7.9 KB (added by AntoineLatter, 4 years ago)

patch for libraries/integer-gmp

Line 
1Fri Jan  1 12:34:37 CST 2010  Antoine Latter <aslatter@gmail.com>
2  * FIX #38000 Store StgArrWords payload size in bytes
3
4New patches:
5
6[FIX #38000 Store StgArrWords payload size in bytes
7Antoine Latter <aslatter@gmail.com>**20100101183437
8 Ignore-this: fa302232d6a198a29c3f0f239e4e098
9] {
10hunk ./cbits/gmp-wrappers.cmm 70
11 
12    p = Hp - SIZEOF_StgArrWords;
13    SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
14-   StgArrWords_words(p) = 1;
15+   StgArrWords_bytes(p) = SIZEOF_W;
16 
17    /* mpz_set_si is inlined here, makes things simpler */
18    if (%lt(val,0)) {
19hunk ./cbits/gmp-wrappers.cmm 104
20 
21    p = Hp - SIZEOF_StgArrWords;
22    SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
23-   StgArrWords_words(p) = 1;
24+   StgArrWords_bytes(p) = SIZEOF_W;
25 
26    if (val != 0) {
27         s = 1;
28hunk ./cbits/gmp-wrappers.cmm 151
29 
30    p = Hp - SIZEOF_StgArrWords - WDS(words_needed) + WDS(1);
31    SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
32-   StgArrWords_words(p) = words_needed;
33+   StgArrWords_bytes(p) = WDS(words_needed);
34 
35    if ( %lt(hi,0) ) {
36      neg = 1;
37hunk ./cbits/gmp-wrappers.cmm 206
38 
39    p = Hp - SIZEOF_StgArrWords - WDS(words_needed) + WDS(1);
40    SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
41-   StgArrWords_words(p) = words_needed;
42+   StgArrWords_bytes(p) = WDS(words_needed);
43 
44    if ( hi != 0 ) {
45      s = 2;
46hunk ./cbits/gmp-wrappers.cmm 251
47   mp_tmp1    = Sp - 1 * SIZEOF_MP_INT;                                  \
48   mp_tmp2    = Sp - 2 * SIZEOF_MP_INT;                                  \
49   mp_result1 = Sp - 3 * SIZEOF_MP_INT;                                  \
50-  MP_INT__mp_alloc(mp_tmp1) = W_TO_INT(StgArrWords_words(d1));          \
51+  MP_INT__mp_alloc(mp_tmp1) = W_TO_INT(BYTE_ARR_WDS(d1));               \
52   MP_INT__mp_size(mp_tmp1)  = (s1);                                     \
53   MP_INT__mp_d(mp_tmp1)     = BYTE_ARR_CTS(d1);                         \
54hunk ./cbits/gmp-wrappers.cmm 254
55-  MP_INT__mp_alloc(mp_tmp2) = W_TO_INT(StgArrWords_words(d2));          \
56+  MP_INT__mp_alloc(mp_tmp2) = W_TO_INT(BYTE_ARR_WDS(d2));               \
57   MP_INT__mp_size(mp_tmp2)  = (s2);                                     \
58   MP_INT__mp_d(mp_tmp2)     = BYTE_ARR_CTS(d2);                         \
59                                                                         \
60hunk ./cbits/gmp-wrappers.cmm 287
61                                                                         \
62   mp_tmp     = Sp - 1 * SIZEOF_MP_INT;                                  \
63   mp_result  = Sp - 2 * SIZEOF_MP_INT;                                  \
64-  MP_INT__mp_alloc(mp_tmp) = W_TO_INT(StgArrWords_words(d1));           \
65+  MP_INT__mp_alloc(mp_tmp) = W_TO_INT(BYTE_ARR_WDS(d1));                \
66   MP_INT__mp_size(mp_tmp)  = (s1);                                      \
67   MP_INT__mp_d(mp_tmp)     = BYTE_ARR_CTS(d1);                          \
68                                                                         \
69hunk ./cbits/gmp-wrappers.cmm 318
70                                                                         \
71   mp_tmp1    = Sp - 1 * SIZEOF_MP_INT;                                  \
72   mp_result1 = Sp - 2 * SIZEOF_MP_INT;                                  \
73-  MP_INT__mp_alloc(mp_tmp1)     = W_TO_INT(StgArrWords_words(d1));      \
74+  MP_INT__mp_alloc(mp_tmp1)     = W_TO_INT(BYTE_ARR_WDS(d1));           \
75   MP_INT__mp_size(mp_tmp1)      = (s1);                                 \
76   MP_INT__mp_d(mp_tmp1)         = BYTE_ARR_CTS(d1);                     \
77                                                                         \
78hunk ./cbits/gmp-wrappers.cmm 355
79   mp_tmp2    = Sp - 2 * SIZEOF_MP_INT;                                                  \
80   mp_result1 = Sp - 3 * SIZEOF_MP_INT;                                                  \
81   mp_result2 = Sp - 4 * SIZEOF_MP_INT;                                                  \
82-  MP_INT__mp_alloc(mp_tmp1)     = W_TO_INT(StgArrWords_words(d1));                      \
83+  MP_INT__mp_alloc(mp_tmp1)     = W_TO_INT(BYTE_ARR_WDS(d1));                           \
84   MP_INT__mp_size(mp_tmp1)      = (s1);                                                 \
85   MP_INT__mp_d(mp_tmp1)         = BYTE_ARR_CTS(d1);                                     \
86hunk ./cbits/gmp-wrappers.cmm 358
87-  MP_INT__mp_alloc(mp_tmp2)     = W_TO_INT(StgArrWords_words(d2));                      \
88+  MP_INT__mp_alloc(mp_tmp2)     = W_TO_INT(BYTE_ARR_WDS(d2));                           \
89   MP_INT__mp_size(mp_tmp2)      = (s2);                                                 \
90   MP_INT__mp_d(mp_tmp2)         = BYTE_ARR_CTS(d2);                                     \
91                                                                                         \
92hunk ./cbits/gmp-wrappers.cmm 574
93        where mantissa.d can be put (it does not care about the rest) */
94     p = Hp - ARR_SIZE + WDS(1);
95     SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
96-    StgArrWords_words(p) = BYTES_TO_WDS(DOUBLE_MANTISSA_SIZE);
97+    StgArrWords_bytes(p) = DOUBLE_MANTISSA_SIZE;
98     MP_INT__mp_d(mp_tmp1) = BYTE_ARR_CTS(p);
99 
100     /* Perform the operation */
101}
102
103Context:
104
105[Move .depend file dependency inside HaveLibGmp test
106Simon Marlow <marlowsd@gmail.com>**20091217202323
107 Ignore-this: 85bb1938652b68624cf7bf9e18364cff
108 We were building GMP even if we didn't need to.
109]
110[Fix a makefile dep
111Ian Lynagh <igloo@earth.li>**20091216131342]
112[Add a missing dependency on gmp.h
113Ian Lynagh <igloo@earth.li>**20091215132010]
114[allocateLocal was renamed to allocate
115Simon Marlow <marlowsd@gmail.com>**20091202091517
116 Ignore-this: 6f7f134f2e6c317fc3f8e5e4b6bdda3f
117]
118[Undo previous patch, caused linker problems on x86_64/linux
119Ben.Lippmeier@anu.edu.au**20091124031254
120 Ignore-this: 8a753bc4aee6a55212a47c3996da0819
121 
122 rolling back:
123 
124 Sat Nov 21 16:43:13 EST 2009  Ben.Lippmeier@anu.edu.au
125   * Windows DLLs: Tag imported gmp symbols with the package they're from.
126 
127     M ./cbits/gmp-wrappers.cmm -20 +20
128]
129[Windows DLLs: Tag imported gmp symbols with the package they're from.
130Ben.Lippmeier@anu.edu.au**20091121054313]
131[Set the path to nm before configuring the C gmp lib
132Ian Lynagh <igloo@earth.li>**20091012214031]
133[Bump version to 0.2.0.0
134Ian Lynagh <igloo@earth.li>**20090920141926]
135[Use CONF_CC_OPTS
136Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20090917131307
137 Ignore-this: 96ce307ffed652681de8831d978ea80e
138 - Needed to get arch-dependent options, eg, on Snow Leopard
139]
140[Update to follow RTS tidyp changes
141Simon Marlow <marlowsd@gmail.com>**20090801193513
142 Ignore-this: cbb5febb94a61fe9d76c3bc7fa7b84d6
143]
144[fix conditionals (prevents GMP always being built)
145Simon Marlow <marlowsd@gmail.com>**20090801223724
146 Ignore-this: 622e4bd43116e8825ceac41bfd19a1cb
147]
148[Fix GC annotations in GMP_TAKE1_UL1_RET1()
149Simon Marlow <marlowsd@gmail.com>**20090723123901
150 Ignore-this: 48d367b22fb8816922fdddcdc01563fc
151]
152[Add primops for shifting
153Ian Lynagh <igloo@earth.li>**20090722014840]
154[Remove unused stack variable
155Ian Lynagh <igloo@earth.li>**20090721202807]
156[Whitespace only, in gmp-wrappers.cmm
157Ian Lynagh <igloo@earth.li>**20090721202640]
158[Make integer-gmp suitable to be used directly, rather than via integer
159Ian Lynagh <igloo@earth.li>**20090721185302]
160[Add GmpDerivedConstants.h dependencies for all ways, not just vanilla
161Ian Lynagh <igloo@earth.li>**20090718145628]
162[fix mk/build.mk for HaveLibGmp/HaveFrameworkGMP
163Austin Seipp <as@nijoruj.org>**20090706213937
164 Ignore-this: 39491db02c9308ebf713f64a2c4536f8
165 Previously if you were to set HaveFrameworkGMP/HaveLibGmp in
166 mk/build.mk (e.g. on mac os) the settings would be ignored, as
167 gmp/config.mk is included late in GHC's ghc.mk, meaning autoconf
168 overrides your settings. Now they ignore the values picked up by
169 configure if you set these variables.
170]
171[Check for whether we have gmp.h, as well as whether we have the gmp library
172Ian Lynagh <igloo@earth.li>**20090625162933]
173[Fix the case of HaveFrameworkGMP values
174Ian Lynagh <igloo@earth.li>**20090625162544]
175[TAG 2009-06-25
176Ian Lynagh <igloo@earth.li>**20090625160253]
177Patch bundle hash:
1786e82700b29de9427bf43082f986076b7d7a6c5e5