Ticket #4207: en.cmmcpp

File en.cmmcpp, 24.8 KB (added by slyfox, 4 years ago)

english

Line 
1# 1 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
2# 1 "<built-in>"
3# 1 "<command-line>"
4# 1 "./libraries/integer-gmp/dist-install/build/autogen/cabal_macros.h" 1
5# 1 "<command-line>" 2
6# 1 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
7# 28 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
8# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 1
9# 68 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h"
10# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/ghcconfig.h" 1
11
12
13
14# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/ghcautoconf.h" 1
15# 5 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/ghcconfig.h" 2
16# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/ghcplatform.h" 1
17# 6 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/ghcconfig.h" 2
18# 69 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
19# 334 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h"
20# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/Constants.h" 1
21# 335 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
22# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/DerivedConstants.h" 1
23# 336 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
24# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/storage/ClosureTypes.h" 1
25# 337 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
26# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/storage/FunTypes.h" 1
27# 338 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
28# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/storage/SMPClosureOps.h" 1
29# 339 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
30# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/OSThreads.h" 1
31# 340 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
32
33
34
35
36
37
38# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/stg/MachRegs.h" 1
39# 347 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
40
41# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/storage/Liveness.h" 1
42# 349 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
43# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/prof/LDV.h" 1
44# 350 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
45
46
47
48# 1 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/rts/storage/Block.h" 1
49# 354 "/home/slyfox/portage/gentoo-haskell/dev-lang/ghc/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/includes/Cmm.h" 2
50# 29 "libraries/integer-gmp/cbits/gmp-wrappers.cmm" 2
51# 1 "libraries/integer-gmp/cbits/GmpDerivedConstants.h" 1
52# 30 "libraries/integer-gmp/cbits/gmp-wrappers.cmm" 2
53# 59 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
54integer_cmm_int2Integerzh
55{
56
57
58   bits64 val, s, p;
59
60   val = R1;
61   HP_CHK_GEN((SIZEOF_StgHeader+8) + ((1)*8),0xff,integer_cmm_int2Integerzh); ; ;; TICK_ALLOC_PRIM(SIZEOF_StgHeader,(SIZEOF_StgHeader+8) + ((1)*8)-SIZEOF_StgHeader,0); CCS_ALLOC((((SIZEOF_StgHeader+8) + ((1)*8)) / 8), bits64[CCCS]);;
62
63   p = Hp - (SIZEOF_StgHeader+8);
64   SET_HDR(p, stg_ARR_WORDS_info, bits64[CCCS]);
65   b64[p+SIZEOF_StgHeader+0] = 1;
66
67
68   if (%lt(val,0)) {
69        s = -1;
70        bits64[Hp + ((0)*8)] = -val;
71   } else {
72     if (%gt(val,0)) {
73        s = 1;
74        bits64[Hp + ((0)*8)] = val;
75     } else {
76        s = 0;
77     }
78  }
79
80
81
82
83
84   RET_NP(s,p);
85}
86
87integer_cmm_word2Integerzh
88{
89
90
91   bits64 val, s, p;
92
93   val = R1;
94
95   HP_CHK_GEN((SIZEOF_StgHeader+8) + ((1)*8),0xff,integer_cmm_word2Integerzh); ; ;; TICK_ALLOC_PRIM(SIZEOF_StgHeader,(SIZEOF_StgHeader+8) + ((1)*8)-SIZEOF_StgHeader,0); CCS_ALLOC((((SIZEOF_StgHeader+8) + ((1)*8)) / 8), bits64[CCCS]);;
96
97   p = Hp - (SIZEOF_StgHeader+8);
98   SET_HDR(p, stg_ARR_WORDS_info, bits64[CCCS]);
99   b64[p+SIZEOF_StgHeader+0] = 1;
100
101   if (val != 0) {
102        s = 1;
103        bits64[Hp] = val;
104   } else {
105        s = 0;
106   }
107
108
109
110
111   RET_NP(s,p);
112}
113# 126 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
114integer_cmm_int64ToIntegerzh
115{
116
117
118   bits64 val;
119   bits64 hi, lo, s, neg, words_needed, p;
120
121   val = L1;
122   neg = 0;
123
124   hi = %sx64(val >> 32);
125   lo = %sx64(val);
126
127   if ( hi == 0 || (hi == 0xFFFFFFFF && lo != 0) ) {
128
129       words_needed = 1;
130   } else {
131       words_needed = 2;
132   }
133
134   HP_CHK_GEN((SIZEOF_StgHeader+8) + ((words_needed)*8),0xff,integer_cmm_int64ToIntegerzh); ; ;; TICK_ALLOC_PRIM(SIZEOF_StgHeader,(SIZEOF_StgHeader+8) + ((words_needed)*8)-SIZEOF_StgHeader,0); CCS_ALLOC((((SIZEOF_StgHeader+8) + ((words_needed)*8)) / 8), bits64[CCCS]);;
135
136
137   p = Hp - (SIZEOF_StgHeader+8) - ((words_needed)*8) + ((1)*8);
138   SET_HDR(p, stg_ARR_WORDS_info, bits64[CCCS]);
139   b64[p+SIZEOF_StgHeader+0] = words_needed;
140
141   if ( %lt(hi,0) ) {
142     neg = 1;
143     lo = -lo;
144     if(lo == 0) {
145       hi = -hi;
146     } else {
147       hi = -hi - 1;
148     }
149   }
150
151   if ( words_needed == 2 ) {
152      s = 2;
153      bits64[Hp + ((-1)*8)] = lo;
154      bits64[Hp + ((0)*8)] = hi;
155   } else {
156       if ( lo != 0 ) {
157           s = 1;
158           bits64[Hp + ((0)*8)] = lo;
159       } else {
160           s = 0;
161       }
162   }
163   if ( neg != 0 ) {
164        s = -s;
165   }
166
167
168
169
170   RET_NP(s,p);
171}
172integer_cmm_word64ToIntegerzh
173{
174
175
176   bits64 val;
177   bits64 hi, lo, s, words_needed, p;
178
179   val = L1;
180   hi = %sx64(val >> 32);
181   lo = %sx64(val);
182
183   if ( hi != 0 ) {
184      words_needed = 2;
185   } else {
186      words_needed = 1;
187   }
188
189   HP_CHK_GEN((SIZEOF_StgHeader+8) + ((words_needed)*8),0xff,integer_cmm_word64ToIntegerzh); ; ;; TICK_ALLOC_PRIM(SIZEOF_StgHeader,(SIZEOF_StgHeader+8) + ((words_needed)*8)-SIZEOF_StgHeader,0); CCS_ALLOC((((SIZEOF_StgHeader+8) + ((words_needed)*8)) / 8), bits64[CCCS]);;
190
191
192   p = Hp - (SIZEOF_StgHeader+8) - ((words_needed)*8) + ((1)*8);
193   SET_HDR(p, stg_ARR_WORDS_info, bits64[CCCS]);
194   b64[p+SIZEOF_StgHeader+0] = words_needed;
195
196   if ( hi != 0 ) {
197     s = 2;
198     bits64[Hp + ((-1)*8)] = lo;
199     bits64[Hp + ((0)*8)] = hi;
200   } else {
201      if ( lo != 0 ) {
202        s = 1;
203        bits64[Hp + ((0)*8)] = lo;
204     } else {
205      s = 0;
206     }
207  }
208
209
210
211
212   RET_NP(s,p);
213}
214# 374 "libraries/integer-gmp/cbits/gmp-wrappers.cmm"
215integer_cmm_plusIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_plusIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_plusIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_add(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
216integer_cmm_minusIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_minusIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_minusIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_sub(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
217integer_cmm_timesIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_timesIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_timesIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_mul(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
218integer_cmm_gcdIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_gcdIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_gcdIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_gcd(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
219integer_cmm_quotIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_quotIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_quotIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_tdiv_q(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
220integer_cmm_remIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_remIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_remIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_tdiv_r(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
221integer_cmm_divExactIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_divExactIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_divExactIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_divexact(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
222integer_cmm_andIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_andIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_andIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_and(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
223integer_cmm_orIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_orIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_orIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_ior(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
224integer_cmm_xorIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_xorIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 3 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_xorIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_xor(mp_result1 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
225integer_cmm_mul2ExpIntegerzh { bits32 s1; bits64 d1; bits64 ul; bits64 mp_tmp; bits64 mp_result; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)); R10 = integer_cmm_mul2ExpIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 2 * 16, (0xff ^ (1<<1)), integer_cmm_mul2ExpIntegerzh ); s1 = %lobits32(R1); d1 = R2; ul = R3; mp_tmp = Sp - 1 * 16; mp_result = Sp - 2 * 16; b32[mp_tmp+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp+4] = (s1); b64[mp_tmp+8] = ((d1) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result "ptr") []; foreign "C" __gmpz_mul_2exp(mp_result "ptr",mp_tmp "ptr", ul) []; RET_NP(%sx64(b32[mp_result+4]), b64[mp_result+8] - (SIZEOF_StgHeader+8)); }
226integer_cmm_fdivQ2ExpIntegerzh { bits32 s1; bits64 d1; bits64 ul; bits64 mp_tmp; bits64 mp_result; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)); R10 = integer_cmm_fdivQ2ExpIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 2 * 16, (0xff ^ (1<<1)), integer_cmm_fdivQ2ExpIntegerzh ); s1 = %lobits32(R1); d1 = R2; ul = R3; mp_tmp = Sp - 1 * 16; mp_result = Sp - 2 * 16; b32[mp_tmp+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp+4] = (s1); b64[mp_tmp+8] = ((d1) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result "ptr") []; foreign "C" __gmpz_fdiv_q_2exp(mp_result "ptr",mp_tmp "ptr", ul) []; RET_NP(%sx64(b32[mp_result+4]), b64[mp_result+8] - (SIZEOF_StgHeader+8)); }
227integer_cmm_complementIntegerzh { bits32 s1; bits64 d1; bits64 mp_tmp1; bits64 mp_result1; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)); R10 = integer_cmm_complementIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 2 * 16, (0xff ^ (1<<1)), integer_cmm_complementIntegerzh ); d1 = R2; s1 = %lobits32(R1); mp_tmp1 = Sp - 1 * 16; mp_result1 = Sp - 2 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_com(mp_result1 "ptr",mp_tmp1 "ptr") []; RET_NP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8)); }
228
229integer_cmm_quotRemIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; bits64 mp_result2; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_quotRemIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 4 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_quotRemIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; mp_result2 = Sp - 4 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_init(mp_result2 "ptr") []; foreign "C" __gmpz_tdiv_qr(mp_result1 "ptr",mp_result2 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NPNP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8), %sx64(b32[mp_result2+4]), b64[mp_result2+8] - (SIZEOF_StgHeader+8)); }
230integer_cmm_divModIntegerzh { bits32 s1, s2; bits64 d1, d2; bits64 mp_tmp1; bits64 mp_tmp2; bits64 mp_result1; bits64 mp_result2; if (b64[CurrentNursery+16] == (0::bits64) || bits32[alloc_blocks] >= bits32[alloc_blocks_lim]) { R9 = (0xff ^ (1<<1)) & (0xff ^ (1<<3)); R10 = integer_cmm_divModIntegerzh; HpAlloc = 0; jump stg_gc_gen_hp; }; STK_CHK_GEN( 4 * 16, (0xff ^ (1<<1)) & (0xff ^ (1<<3)), integer_cmm_divModIntegerzh ); s1 = %lobits32(R1); d1 = R2; s2 = %lobits32(R3); d2 = R4; mp_tmp1 = Sp - 1 * 16; mp_tmp2 = Sp - 2 * 16; mp_result1 = Sp - 3 * 16; mp_result2 = Sp - 4 * 16; b32[mp_tmp1+0] = %lobits32(b64[d1+SIZEOF_StgHeader+0]); b32[mp_tmp1+4] = (s1); b64[mp_tmp1+8] = ((d1) + (SIZEOF_StgHeader+8)); b32[mp_tmp2+0] = %lobits32(b64[d2+SIZEOF_StgHeader+0]); b32[mp_tmp2+4] = (s2); b64[mp_tmp2+8] = ((d2) + (SIZEOF_StgHeader+8)); foreign "C" __gmpz_init(mp_result1 "ptr") []; foreign "C" __gmpz_init(mp_result2 "ptr") []; foreign "C" __gmpz_fdiv_qr(mp_result1 "ptr",mp_result2 "ptr",mp_tmp1 "ptr",mp_tmp2 "ptr") []; RET_NPNP(%sx64(b32[mp_result1+4]), b64[mp_result1+8] - (SIZEOF_StgHeader+8), %sx64(b32[mp_result2+4]), b64[mp_result2+8] - (SIZEOF_StgHeader+8)); }
231
232integer_cmm_gcdIntzh
233{
234
235    bits64 r;
236    bits64 mp_tmp_w;
237
238    STK_CHK_GEN( 1 * 16, 0xff, integer_cmm_gcdIntzh );
239
240    mp_tmp_w = Sp - 1 * 16;
241
242    bits64[mp_tmp_w] = R1;
243    (r) = foreign "C" __gmpn_gcd_1(mp_tmp_w "ptr", 1, R2) [];
244
245    R1 = r;
246
247    jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
248}
249
250
251integer_cmm_gcdIntegerIntzh
252{
253
254    bits64 s1;
255    (s1) = foreign "C" __gmpn_gcd_1( ((R2) + (SIZEOF_StgHeader+8)) "ptr", R1, R3) [];
256    R1 = s1;
257
258
259    jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
260}
261
262
263integer_cmm_cmpIntegerIntzh
264{
265
266    bits64 usize, vsize, v_digit, u_digit;
267
268    usize = R1;
269    vsize = 0;
270    v_digit = R3;
271
272
273    if (%gt(v_digit,0)) {
274        vsize = 1;
275    } else {
276        if (%lt(v_digit,0)) {
277            vsize = -1;
278            v_digit = -v_digit;
279        }
280    }
281
282    if (usize != vsize) {
283        R1 = usize - vsize;
284        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
285    }
286
287    if (usize == 0) {
288        R1 = 0;
289        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
290    }
291
292    u_digit = bits64[((R2) + (SIZEOF_StgHeader+8))];
293
294    if (u_digit == v_digit) {
295        R1 = 0;
296        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
297    }
298
299    if (%gtu(u_digit,v_digit)) {
300        R1 = usize;
301    } else {
302        R1 = -usize;
303    }
304
305    jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
306}
307
308integer_cmm_cmpIntegerzh
309{
310
311    bits64 usize, vsize, size, up, vp;
312    bits32 cmp;
313
314
315    usize = R1;
316    vsize = R3;
317
318    if (usize != vsize) {
319        R1 = usize - vsize;
320        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
321    }
322
323    if (usize == 0) {
324        R1 = 0;
325        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
326    }
327
328    if (%lt(usize,0)) {
329        size = -usize;
330    } else {
331        size = usize;
332    }
333
334    up = ((R2) + (SIZEOF_StgHeader+8));
335    vp = ((R4) + (SIZEOF_StgHeader+8));
336
337    (cmp) = foreign "C" __gmpn_cmp(up "ptr", vp "ptr", size) [];
338
339    if (cmp == 0 :: bits32) {
340        R1 = 0;
341        jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
342    }
343
344    if (%lt(cmp,0 :: bits32) == %lt(usize,0)) {
345        R1 = 1;
346    } else {
347        R1 = (-1);
348    }
349
350    jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
351}
352
353integer_cmm_integer2Intzh
354{
355
356    bits64 r, s;
357
358    s = R1;
359    if (s == 0) {
360        r = 0;
361    } else {
362        r = bits64[R2 + (SIZEOF_StgHeader+8)];
363        if (%lt(s,0)) {
364            r = -r;
365        }
366    }
367
368    R1 = r;
369    jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
370}
371
372integer_cmm_integer2Wordzh
373{
374
375  bits64 r, s;
376
377  s = R1;
378  if (s == 0) {
379    r = 0;
380  } else {
381    r = bits64[R2 + (SIZEOF_StgHeader+8)];
382    if (%lt(s,0)) {
383        r = -r;
384    }
385  }
386
387  R1 = r;
388  jump %ENTRY_CODE(bits64[Sp + ((0)*8)]);
389}
390
391
392
393
394integer_cmm_decodeDoublezh
395{
396    float64 arg;
397    bits64 p;
398    bits64 mp_tmp1;
399    bits64 mp_tmp_w;
400
401    STK_CHK_GEN( 2 * 16, 0xff, integer_cmm_decodeDoublezh );
402
403    mp_tmp1 = Sp - 1 * 16;
404    mp_tmp_w = Sp - 2 * 16;
405
406
407    arg = D1;
408
409    HP_CHK_GEN(((SIZEOF_StgHeader+8) + 8),0xff,integer_cmm_decodeDoublezh); ; ;; TICK_ALLOC_PRIM(SIZEOF_StgHeader,((SIZEOF_StgHeader+8) + 8)-SIZEOF_StgHeader,0); CCS_ALLOC(((((SIZEOF_StgHeader+8) + 8)) / 8), bits64[CCCS]);;
410
411
412
413    p = Hp - ((SIZEOF_StgHeader+8) + 8) + ((1)*8);
414    SET_HDR(p, stg_ARR_WORDS_info, bits64[CCCS]);
415    b64[p+SIZEOF_StgHeader+0] = ((8) / 8);
416    b64[mp_tmp1+8] = ((p) + (SIZEOF_StgHeader+8));
417
418
419    foreign "C" integer_cbits_decodeDouble(mp_tmp1 "ptr", mp_tmp_w "ptr",arg) [];
420
421
422    RET_NNP(bits64[mp_tmp_w], %sx64(b32[mp_tmp1+4]), p);
423}