on master help sign in
Namespace the ClosureType enums.
23df314Niklas Larsson
rts/idris_bitstring.c+86−86
@@ -5,7 +5,7 @@
5VAL idris_b8CopyForGC(VM *vm, VAL a) {
5VAL idris_b8CopyForGC(VM *vm, VAL a) {
6 uint8_t A = a->info.bits8;
6 uint8_t A = a->info.bits8;
7 VAL cl = allocate(sizeof(Closure), 1);
7 VAL cl = allocate(sizeof(Closure), 1);
8− SETTY(cl, BITS8);
8+ SETTY(cl, CT_BITS8);
9 cl->info.bits8 = A;
9 cl->info.bits8 = A;
10 return cl;
10 return cl;
11}
11}
@@ -13,7 +13,7 @@ VAL idris_b8CopyForGC(VM *vm, VAL a) {
13VAL idris_b16CopyForGC(VM *vm, VAL a) {
13VAL idris_b16CopyForGC(VM *vm, VAL a) {
14 uint16_t A = a->info.bits16;
14 uint16_t A = a->info.bits16;
15 VAL cl = allocate(sizeof(Closure), 1);
15 VAL cl = allocate(sizeof(Closure), 1);
16− SETTY(cl, BITS16);
16+ SETTY(cl, CT_BITS16);
17 cl->info.bits16 = A;
17 cl->info.bits16 = A;
18 return cl;
18 return cl;
19}
19}
@@ -21,7 +21,7 @@ VAL idris_b16CopyForGC(VM *vm, VAL a) {
21VAL idris_b32CopyForGC(VM *vm, VAL a) {
21VAL idris_b32CopyForGC(VM *vm, VAL a) {
22 uint32_t A = a->info.bits32;
22 uint32_t A = a->info.bits32;
23 VAL cl = allocate(sizeof(Closure), 1);
23 VAL cl = allocate(sizeof(Closure), 1);
24− SETTY(cl, BITS32);
24+ SETTY(cl, CT_BITS32);
25 cl->info.bits32 = A;
25 cl->info.bits32 = A;
26 return cl;
26 return cl;
27}
27}
@@ -29,7 +29,7 @@ VAL idris_b32CopyForGC(VM *vm, VAL a) {
29VAL idris_b64CopyForGC(VM *vm, VAL a) {
29VAL idris_b64CopyForGC(VM *vm, VAL a) {
30 uint64_t A = a->info.bits64;
30 uint64_t A = a->info.bits64;
31 VAL cl = allocate(sizeof(Closure), 1);
31 VAL cl = allocate(sizeof(Closure), 1);
32− SETTY(cl, BITS64);
32+ SETTY(cl, CT_BITS64);
33 cl->info.bits64 = A;
33 cl->info.bits64 = A;
34 return cl;
34 return cl;
35}
35}
@@ -37,7 +37,7 @@ VAL idris_b64CopyForGC(VM *vm, VAL a) {
37VAL idris_b8(VM *vm, VAL a) {
37VAL idris_b8(VM *vm, VAL a) {
38 uint8_t A = GETINT(a);
38 uint8_t A = GETINT(a);
39 VAL cl = allocate(sizeof(Closure), 0);
39 VAL cl = allocate(sizeof(Closure), 0);
40− SETTY(cl, BITS8);
40+ SETTY(cl, CT_BITS8);
41 cl->info.bits8 = (uint8_t) A;
41 cl->info.bits8 = (uint8_t) A;
42 return cl;
42 return cl;
43}
43}
@@ -45,7 +45,7 @@ VAL idris_b8(VM *vm, VAL a) {
45VAL idris_b16(VM *vm, VAL a) {
45VAL idris_b16(VM *vm, VAL a) {
46 uint16_t A = GETINT(a);
46 uint16_t A = GETINT(a);
47 VAL cl = allocate(sizeof(Closure), 0);
47 VAL cl = allocate(sizeof(Closure), 0);
48− SETTY(cl, BITS16);
48+ SETTY(cl, CT_BITS16);
49 cl->info.bits16 = (uint16_t) A;
49 cl->info.bits16 = (uint16_t) A;
50 return cl;
50 return cl;
51}
51}
@@ -53,7 +53,7 @@ VAL idris_b16(VM *vm, VAL a) {
53VAL idris_b32(VM *vm, VAL a) {
53VAL idris_b32(VM *vm, VAL a) {
54 uint32_t A = GETINT(a);
54 uint32_t A = GETINT(a);
55 VAL cl = allocate(sizeof(Closure), 0);
55 VAL cl = allocate(sizeof(Closure), 0);
56− SETTY(cl, BITS32);
56+ SETTY(cl, CT_BITS32);
57 cl->info.bits32 = (uint32_t) A;
57 cl->info.bits32 = (uint32_t) A;
58 return cl;
58 return cl;
59}
59}
@@ -61,7 +61,7 @@ VAL idris_b32(VM *vm, VAL a) {
61VAL idris_b64(VM *vm, VAL a) {
61VAL idris_b64(VM *vm, VAL a) {
62 uint64_t A = GETINT(a);
62 uint64_t A = GETINT(a);
63 VAL cl = allocate(sizeof(Closure), 0);
63 VAL cl = allocate(sizeof(Closure), 0);
64− SETTY(cl, BITS64);
64+ SETTY(cl, CT_BITS64);
65 cl->info.bits64 = (uint64_t) A;
65 cl->info.bits64 = (uint64_t) A;
66 return cl;
66 return cl;
67}
67}
@@ -72,28 +72,28 @@ VAL idris_castB32Int(VM *vm, VAL a) {
72
72
73VAL idris_b8const(VM *vm, uint8_t a) {
73VAL idris_b8const(VM *vm, uint8_t a) {
74 VAL cl = allocate(sizeof(Closure), 0);
74 VAL cl = allocate(sizeof(Closure), 0);
75− SETTY(cl, BITS8);
75+ SETTY(cl, CT_BITS8);
76 cl->info.bits8 = a;
76 cl->info.bits8 = a;
77 return cl;
77 return cl;
78}
78}
79
79
80VAL idris_b16const(VM *vm, uint16_t a) {
80VAL idris_b16const(VM *vm, uint16_t a) {
81 VAL cl = allocate(sizeof(Closure), 0);
81 VAL cl = allocate(sizeof(Closure), 0);
82− SETTY(cl, BITS16);
82+ SETTY(cl, CT_BITS16);
83 cl->info.bits16 = a;
83 cl->info.bits16 = a;
84 return cl;
84 return cl;
85}
85}
86
86
87VAL idris_b32const(VM *vm, uint32_t a) {
87VAL idris_b32const(VM *vm, uint32_t a) {
88 VAL cl = allocate(sizeof(Closure), 0);
88 VAL cl = allocate(sizeof(Closure), 0);
89− SETTY(cl, BITS32);
89+ SETTY(cl, CT_BITS32);
90 cl->info.bits32 = a;
90 cl->info.bits32 = a;
91 return cl;
91 return cl;
92}
92}
93
93
94VAL idris_b64const(VM *vm, uint64_t a) {
94VAL idris_b64const(VM *vm, uint64_t a) {
95 VAL cl = allocate(sizeof(Closure), 0);
95 VAL cl = allocate(sizeof(Closure), 0);
96− SETTY(cl, BITS64);
96+ SETTY(cl, CT_BITS64);
97 cl->info.bits64 = a;
97 cl->info.bits64 = a;
98 return cl;
98 return cl;
99}
99}
@@ -102,7 +102,7 @@ VAL idris_b8Plus(VM *vm, VAL a, VAL b) {
102 uint8_t A = a->info.bits8;
102 uint8_t A = a->info.bits8;
103 uint8_t B = b->info.bits8;
103 uint8_t B = b->info.bits8;
104 VAL cl = allocate(sizeof(Closure), 0);
104 VAL cl = allocate(sizeof(Closure), 0);
105− SETTY(cl, BITS8);
105+ SETTY(cl, CT_BITS8);
106 cl->info.bits8 = A + B;
106 cl->info.bits8 = A + B;
107 return cl;
107 return cl;
108}
108}
@@ -111,7 +111,7 @@ VAL idris_b8Minus(VM *vm, VAL a, VAL b) {
111 uint8_t A = a->info.bits8;
111 uint8_t A = a->info.bits8;
112 uint8_t B = b->info.bits8;
112 uint8_t B = b->info.bits8;
113 VAL cl = allocate(sizeof(Closure), 0);
113 VAL cl = allocate(sizeof(Closure), 0);
114− SETTY(cl, BITS8);
114+ SETTY(cl, CT_BITS8);
115 cl->info.bits8 = A - B;
115 cl->info.bits8 = A - B;
116 return cl;
116 return cl;
117}
117}
@@ -120,7 +120,7 @@ VAL idris_b8Times(VM *vm, VAL a, VAL b) {
120 uint8_t A = a->info.bits8;
120 uint8_t A = a->info.bits8;
121 uint8_t B = b->info.bits8;
121 uint8_t B = b->info.bits8;
122 VAL cl = allocate(sizeof(Closure), 0);
122 VAL cl = allocate(sizeof(Closure), 0);
123− SETTY(cl, BITS8);
123+ SETTY(cl, CT_BITS8);
124 cl->info.bits8 = A * B;
124 cl->info.bits8 = A * B;
125 return cl;
125 return cl;
126}
126}
@@ -129,7 +129,7 @@ VAL idris_b8UDiv(VM *vm, VAL a, VAL b) {
129 uint8_t A = a->info.bits8;
129 uint8_t A = a->info.bits8;
130 uint8_t B = b->info.bits8;
130 uint8_t B = b->info.bits8;
131 VAL cl = allocate(sizeof(Closure), 0);
131 VAL cl = allocate(sizeof(Closure), 0);
132− SETTY(cl, BITS8);
132+ SETTY(cl, CT_BITS8);
133 cl->info.bits8 = A / B;
133 cl->info.bits8 = A / B;
134 return cl;
134 return cl;
135}
135}
@@ -138,7 +138,7 @@ VAL idris_b8SDiv(VM *vm, VAL a, VAL b) {
138 uint8_t A = a->info.bits8;
138 uint8_t A = a->info.bits8;
139 uint8_t B = b->info.bits8;
139 uint8_t B = b->info.bits8;
140 VAL cl = allocate(sizeof(Closure), 0);
140 VAL cl = allocate(sizeof(Closure), 0);
141− SETTY(cl, BITS8);
141+ SETTY(cl, CT_BITS8);
142 cl->info.bits8 = (uint8_t) (((int8_t) A) / ((int8_t) B));
142 cl->info.bits8 = (uint8_t) (((int8_t) A) / ((int8_t) B));
143 return cl;
143 return cl;
144}
144}
@@ -147,7 +147,7 @@ VAL idris_b8URem(VM *vm, VAL a, VAL b) {
147 uint8_t A = a->info.bits8;
147 uint8_t A = a->info.bits8;
148 uint8_t B = b->info.bits8;
148 uint8_t B = b->info.bits8;
149 VAL cl = allocate(sizeof(Closure), 0);
149 VAL cl = allocate(sizeof(Closure), 0);
150− SETTY(cl, BITS8);
150+ SETTY(cl, CT_BITS8);
151 cl->info.bits8 = A % B;
151 cl->info.bits8 = A % B;
152 return cl;
152 return cl;
153}
153}
@@ -156,7 +156,7 @@ VAL idris_b8SRem(VM *vm, VAL a, VAL b) {
156 uint8_t A = a->info.bits8;
156 uint8_t A = a->info.bits8;
157 uint8_t B = b->info.bits8;
157 uint8_t B = b->info.bits8;
158 VAL cl = allocate(sizeof(Closure), 0);
158 VAL cl = allocate(sizeof(Closure), 0);
159− SETTY(cl, BITS8);
159+ SETTY(cl, CT_BITS8);
160 cl->info.bits8 = (uint8_t) (((int8_t) A) % ((int8_t) B));
160 cl->info.bits8 = (uint8_t) (((int8_t) A) % ((int8_t) B));
161 return cl;
161 return cl;
162}
162}
@@ -184,7 +184,7 @@ VAL idris_b8Gte(VM *vm, VAL a, VAL b) {
184VAL idris_b8Compl(VM *vm, VAL a) {
184VAL idris_b8Compl(VM *vm, VAL a) {
185 uint8_t A = a->info.bits8;
185 uint8_t A = a->info.bits8;
186 VAL cl = allocate(sizeof(Closure), 0);
186 VAL cl = allocate(sizeof(Closure), 0);
187− SETTY(cl, BITS8);
187+ SETTY(cl, CT_BITS8);
188 cl->info.bits8 = ~ A;
188 cl->info.bits8 = ~ A;
189 return cl;
189 return cl;
190}
190}
@@ -193,7 +193,7 @@ VAL idris_b8And(VM *vm, VAL a, VAL b) {
193 uint8_t A = a->info.bits8;
193 uint8_t A = a->info.bits8;
194 uint8_t B = b->info.bits8;
194 uint8_t B = b->info.bits8;
195 VAL cl = allocate(sizeof(Closure), 0);
195 VAL cl = allocate(sizeof(Closure), 0);
196− SETTY(cl, BITS8);
196+ SETTY(cl, CT_BITS8);
197 cl->info.bits8 = A & B;
197 cl->info.bits8 = A & B;
198 return cl;
198 return cl;
199}
199}
@@ -202,7 +202,7 @@ VAL idris_b8Or(VM *vm, VAL a, VAL b) {
202 uint8_t A = a->info.bits8;
202 uint8_t A = a->info.bits8;
203 uint8_t B = b->info.bits8;
203 uint8_t B = b->info.bits8;
204 VAL cl = allocate(sizeof(Closure), 0);
204 VAL cl = allocate(sizeof(Closure), 0);
205− SETTY(cl, BITS8);
205+ SETTY(cl, CT_BITS8);
206 cl->info.bits8 = A | B;
206 cl->info.bits8 = A | B;
207 return cl;
207 return cl;
208}
208}
@@ -211,7 +211,7 @@ VAL idris_b8Xor(VM *vm, VAL a, VAL b) {
211 uint8_t A = a->info.bits8;
211 uint8_t A = a->info.bits8;
212 uint8_t B = b->info.bits8;
212 uint8_t B = b->info.bits8;
213 VAL cl = allocate(sizeof(Closure), 0);
213 VAL cl = allocate(sizeof(Closure), 0);
214− SETTY(cl, BITS8);
214+ SETTY(cl, CT_BITS8);
215 cl->info.bits8 = A ^ B;
215 cl->info.bits8 = A ^ B;
216 return cl;
216 return cl;
217}
217}
@@ -220,7 +220,7 @@ VAL idris_b8Shl(VM *vm, VAL a, VAL b) {
220 uint8_t A = a->info.bits8;
220 uint8_t A = a->info.bits8;
221 uint8_t B = b->info.bits8;
221 uint8_t B = b->info.bits8;
222 VAL cl = allocate(sizeof(Closure), 0);
222 VAL cl = allocate(sizeof(Closure), 0);
223− SETTY(cl, BITS8);
223+ SETTY(cl, CT_BITS8);
224 cl->info.bits8 = A << B;
224 cl->info.bits8 = A << B;
225 return cl;
225 return cl;
226}
226}
@@ -229,7 +229,7 @@ VAL idris_b8LShr(VM *vm, VAL a, VAL b) {
229 uint8_t A = a->info.bits8;
229 uint8_t A = a->info.bits8;
230 uint8_t B = b->info.bits8;
230 uint8_t B = b->info.bits8;
231 VAL cl = allocate(sizeof(Closure), 0);
231 VAL cl = allocate(sizeof(Closure), 0);
232− SETTY(cl, BITS8);
232+ SETTY(cl, CT_BITS8);
233 cl->info.bits8 = A >> B;
233 cl->info.bits8 = A >> B;
234 return cl;
234 return cl;
235}
235}
@@ -238,7 +238,7 @@ VAL idris_b8AShr(VM *vm, VAL a, VAL b) {
238 uint8_t A = a->info.bits8;
238 uint8_t A = a->info.bits8;
239 uint8_t B = b->info.bits8;
239 uint8_t B = b->info.bits8;
240 VAL cl = allocate(sizeof(Closure), 0);
240 VAL cl = allocate(sizeof(Closure), 0);
241− SETTY(cl, BITS8);
241+ SETTY(cl, CT_BITS8);
242 cl->info.bits8 = (uint8_t) (((int8_t) A) >> ((int8_t) B));
242 cl->info.bits8 = (uint8_t) (((int8_t) A) >> ((int8_t) B));
243 return cl;
243 return cl;
244}
244}
@@ -247,7 +247,7 @@ VAL idris_b16Plus(VM *vm, VAL a, VAL b) {
247 uint16_t A = a->info.bits16;
247 uint16_t A = a->info.bits16;
248 uint16_t B = b->info.bits16;
248 uint16_t B = b->info.bits16;
249 VAL cl = allocate(sizeof(Closure), 0);
249 VAL cl = allocate(sizeof(Closure), 0);
250− SETTY(cl, BITS16);
250+ SETTY(cl, CT_BITS16);
251 cl->info.bits16 = A + B;
251 cl->info.bits16 = A + B;
252 return cl;
252 return cl;
253}
253}
@@ -256,7 +256,7 @@ VAL idris_b16Minus(VM *vm, VAL a, VAL b) {
256 uint16_t A = a->info.bits16;
256 uint16_t A = a->info.bits16;
257 uint16_t B = b->info.bits16;
257 uint16_t B = b->info.bits16;
258 VAL cl = allocate(sizeof(Closure), 0);
258 VAL cl = allocate(sizeof(Closure), 0);
259− SETTY(cl, BITS16);
259+ SETTY(cl, CT_BITS16);
260 cl->info.bits16 = A - B;
260 cl->info.bits16 = A - B;
261 return cl;
261 return cl;
262}
262}
@@ -265,7 +265,7 @@ VAL idris_b16Times(VM *vm, VAL a, VAL b) {
265 uint16_t A = a->info.bits16;
265 uint16_t A = a->info.bits16;
266 uint16_t B = b->info.bits16;
266 uint16_t B = b->info.bits16;
267 VAL cl = allocate(sizeof(Closure), 0);
267 VAL cl = allocate(sizeof(Closure), 0);
268− SETTY(cl, BITS16);
268+ SETTY(cl, CT_BITS16);
269 cl->info.bits16 = A * B;
269 cl->info.bits16 = A * B;
270 return cl;
270 return cl;
271}
271}
@@ -274,7 +274,7 @@ VAL idris_b16UDiv(VM *vm, VAL a, VAL b) {
274 uint16_t A = a->info.bits16;
274 uint16_t A = a->info.bits16;
275 uint16_t B = b->info.bits16;
275 uint16_t B = b->info.bits16;
276 VAL cl = allocate(sizeof(Closure), 0);
276 VAL cl = allocate(sizeof(Closure), 0);
277− SETTY(cl, BITS16);
277+ SETTY(cl, CT_BITS16);
278 cl->info.bits16 = A / B;
278 cl->info.bits16 = A / B;
279 return cl;
279 return cl;
280}
280}
@@ -283,7 +283,7 @@ VAL idris_b16SDiv(VM *vm, VAL a, VAL b) {
283 uint16_t A = a->info.bits16;
283 uint16_t A = a->info.bits16;
284 uint16_t B = b->info.bits16;
284 uint16_t B = b->info.bits16;
285 VAL cl = allocate(sizeof(Closure), 0);
285 VAL cl = allocate(sizeof(Closure), 0);
286− SETTY(cl, BITS16);
286+ SETTY(cl, CT_BITS16);
287 cl->info.bits16 = (uint16_t) (((int16_t) A) / ((int16_t) B));
287 cl->info.bits16 = (uint16_t) (((int16_t) A) / ((int16_t) B));
288 return cl;
288 return cl;
289}
289}
@@ -292,7 +292,7 @@ VAL idris_b16URem(VM *vm, VAL a, VAL b) {
292 uint16_t A = a->info.bits16;
292 uint16_t A = a->info.bits16;
293 uint16_t B = b->info.bits16;
293 uint16_t B = b->info.bits16;
294 VAL cl = allocate(sizeof(Closure), 0);
294 VAL cl = allocate(sizeof(Closure), 0);
295− SETTY(cl, BITS16);
295+ SETTY(cl, CT_BITS16);
296 cl->info.bits16 = A % B;
296 cl->info.bits16 = A % B;
297 return cl;
297 return cl;
298}
298}
@@ -301,7 +301,7 @@ VAL idris_b16SRem(VM *vm, VAL a, VAL b) {
301 uint16_t A = a->info.bits16;
301 uint16_t A = a->info.bits16;
302 uint16_t B = b->info.bits16;
302 uint16_t B = b->info.bits16;
303 VAL cl = allocate(sizeof(Closure), 0);
303 VAL cl = allocate(sizeof(Closure), 0);
304− SETTY(cl, BITS16);
304+ SETTY(cl, CT_BITS16);
305 cl->info.bits16 = (uint16_t) (((int16_t) A) % ((int16_t) B));
305 cl->info.bits16 = (uint16_t) (((int16_t) A) % ((int16_t) B));
306 return cl;
306 return cl;
307}
307}
@@ -329,7 +329,7 @@ VAL idris_b16Gte(VM *vm, VAL a, VAL b) {
329VAL idris_b16Compl(VM *vm, VAL a) {
329VAL idris_b16Compl(VM *vm, VAL a) {
330 uint16_t A = a->info.bits16;
330 uint16_t A = a->info.bits16;
331 VAL cl = allocate(sizeof(Closure), 0);
331 VAL cl = allocate(sizeof(Closure), 0);
332− SETTY(cl, BITS16);
332+ SETTY(cl, CT_BITS16);
333 cl->info.bits16 = ~ A;
333 cl->info.bits16 = ~ A;
334 return cl;
334 return cl;
335}
335}
@@ -338,7 +338,7 @@ VAL idris_b16And(VM *vm, VAL a, VAL b) {
338 uint16_t A = a->info.bits16;
338 uint16_t A = a->info.bits16;
339 uint16_t B = b->info.bits16;
339 uint16_t B = b->info.bits16;
340 VAL cl = allocate(sizeof(Closure), 0);
340 VAL cl = allocate(sizeof(Closure), 0);
341− SETTY(cl, BITS16);
341+ SETTY(cl, CT_BITS16);
342 cl->info.bits16 = A & B;
342 cl->info.bits16 = A & B;
343 return cl;
343 return cl;
344}
344}
@@ -347,7 +347,7 @@ VAL idris_b16Or(VM *vm, VAL a, VAL b) {
347 uint16_t A = a->info.bits16;
347 uint16_t A = a->info.bits16;
348 uint16_t B = b->info.bits16;
348 uint16_t B = b->info.bits16;
349 VAL cl = allocate(sizeof(Closure), 0);
349 VAL cl = allocate(sizeof(Closure), 0);
350− SETTY(cl, BITS16);
350+ SETTY(cl, CT_BITS16);
351 cl->info.bits16 = A | B;
351 cl->info.bits16 = A | B;
352 return cl;
352 return cl;
353}
353}
@@ -356,7 +356,7 @@ VAL idris_b16Xor(VM *vm, VAL a, VAL b) {
356 uint16_t A = a->info.bits16;
356 uint16_t A = a->info.bits16;
357 uint16_t B = b->info.bits16;
357 uint16_t B = b->info.bits16;
358 VAL cl = allocate(sizeof(Closure), 0);
358 VAL cl = allocate(sizeof(Closure), 0);
359− SETTY(cl, BITS16);
359+ SETTY(cl, CT_BITS16);
360 cl->info.bits16 = A ^ B;
360 cl->info.bits16 = A ^ B;
361 return cl;
361 return cl;
362}
362}
@@ -365,7 +365,7 @@ VAL idris_b16Shl(VM *vm, VAL a, VAL b) {
365 uint16_t A = a->info.bits16;
365 uint16_t A = a->info.bits16;
366 uint16_t B = b->info.bits16;
366 uint16_t B = b->info.bits16;
367 VAL cl = allocate(sizeof(Closure), 0);
367 VAL cl = allocate(sizeof(Closure), 0);
368− SETTY(cl, BITS16);
368+ SETTY(cl, CT_BITS16);
369 cl->info.bits16 = A << B;
369 cl->info.bits16 = A << B;
370 return cl;
370 return cl;
371}
371}
@@ -374,7 +374,7 @@ VAL idris_b16LShr(VM *vm, VAL a, VAL b) {
374 uint16_t A = a->info.bits16;
374 uint16_t A = a->info.bits16;
375 uint16_t B = b->info.bits16;
375 uint16_t B = b->info.bits16;
376 VAL cl = allocate(sizeof(Closure), 0);
376 VAL cl = allocate(sizeof(Closure), 0);
377− SETTY(cl, BITS16);
377+ SETTY(cl, CT_BITS16);
378 cl->info.bits16 = A >> B;
378 cl->info.bits16 = A >> B;
379 return cl;
379 return cl;
380}
380}
@@ -383,7 +383,7 @@ VAL idris_b16AShr(VM *vm, VAL a, VAL b) {
383 uint16_t A = a->info.bits16;
383 uint16_t A = a->info.bits16;
384 uint16_t B = b->info.bits16;
384 uint16_t B = b->info.bits16;
385 VAL cl = allocate(sizeof(Closure), 0);
385 VAL cl = allocate(sizeof(Closure), 0);
386− SETTY(cl, BITS16);
386+ SETTY(cl, CT_BITS16);
387 cl->info.bits16 = (uint16_t) (((int16_t) A) >> ((int16_t) B));
387 cl->info.bits16 = (uint16_t) (((int16_t) A) >> ((int16_t) B));
388 return cl;
388 return cl;
389}
389}
@@ -392,7 +392,7 @@ VAL idris_b32Plus(VM *vm, VAL a, VAL b) {
392 uint32_t A = a->info.bits32;
392 uint32_t A = a->info.bits32;
393 uint32_t B = b->info.bits32;
393 uint32_t B = b->info.bits32;
394 VAL cl = allocate(sizeof(Closure), 0);
394 VAL cl = allocate(sizeof(Closure), 0);
395− SETTY(cl, BITS32);
395+ SETTY(cl, CT_BITS32);
396 cl->info.bits32 = A + B;
396 cl->info.bits32 = A + B;
397 return cl;
397 return cl;
398}
398}
@@ -401,7 +401,7 @@ VAL idris_b32Minus(VM *vm, VAL a, VAL b) {
401 uint32_t A = a->info.bits32;
401 uint32_t A = a->info.bits32;
402 uint32_t B = b->info.bits32;
402 uint32_t B = b->info.bits32;
403 VAL cl = allocate(sizeof(Closure), 0);
403 VAL cl = allocate(sizeof(Closure), 0);
404− SETTY(cl, BITS32);
404+ SETTY(cl, CT_BITS32);
405 cl->info.bits32 = A - B;
405 cl->info.bits32 = A - B;
406 return cl;
406 return cl;
407}
407}
@@ -410,7 +410,7 @@ VAL idris_b32Times(VM *vm, VAL a, VAL b) {
410 uint32_t A = a->info.bits32;
410 uint32_t A = a->info.bits32;
411 uint32_t B = b->info.bits32;
411 uint32_t B = b->info.bits32;
412 VAL cl = allocate(sizeof(Closure), 0);
412 VAL cl = allocate(sizeof(Closure), 0);
413− SETTY(cl, BITS32);
413+ SETTY(cl, CT_BITS32);
414 cl->info.bits32 = A * B;
414 cl->info.bits32 = A * B;
415 return cl;
415 return cl;
416}
416}
@@ -419,7 +419,7 @@ VAL idris_b32UDiv(VM *vm, VAL a, VAL b) {
419 uint32_t A = a->info.bits32;
419 uint32_t A = a->info.bits32;
420 uint32_t B = b->info.bits32;
420 uint32_t B = b->info.bits32;
421 VAL cl = allocate(sizeof(Closure), 0);
421 VAL cl = allocate(sizeof(Closure), 0);
422− SETTY(cl, BITS32);
422+ SETTY(cl, CT_BITS32);
423 cl->info.bits32 = A / B;
423 cl->info.bits32 = A / B;
424 return cl;
424 return cl;
425}
425}
@@ -428,7 +428,7 @@ VAL idris_b32SDiv(VM *vm, VAL a, VAL b) {
428 uint32_t A = a->info.bits32;
428 uint32_t A = a->info.bits32;
429 uint32_t B = b->info.bits32;
429 uint32_t B = b->info.bits32;
430 VAL cl = allocate(sizeof(Closure), 0);
430 VAL cl = allocate(sizeof(Closure), 0);
431− SETTY(cl, BITS32);
431+ SETTY(cl, CT_BITS32);
432 cl->info.bits32 = (uint32_t) (((int32_t) A) / ((int32_t) B));
432 cl->info.bits32 = (uint32_t) (((int32_t) A) / ((int32_t) B));
433 return cl;
433 return cl;
434}
434}
@@ -437,7 +437,7 @@ VAL idris_b32URem(VM *vm, VAL a, VAL b) {
437 uint32_t A = a->info.bits32;
437 uint32_t A = a->info.bits32;
438 uint32_t B = b->info.bits32;
438 uint32_t B = b->info.bits32;
439 VAL cl = allocate(sizeof(Closure), 0);
439 VAL cl = allocate(sizeof(Closure), 0);
440− SETTY(cl, BITS32);
440+ SETTY(cl, CT_BITS32);
441 cl->info.bits32 = A % B;
441 cl->info.bits32 = A % B;
442 return cl;
442 return cl;
443}
443}
@@ -446,7 +446,7 @@ VAL idris_b32SRem(VM *vm, VAL a, VAL b) {
446 uint32_t A = a->info.bits32;
446 uint32_t A = a->info.bits32;
447 uint32_t B = b->info.bits32;
447 uint32_t B = b->info.bits32;
448 VAL cl = allocate(sizeof(Closure), 0);
448 VAL cl = allocate(sizeof(Closure), 0);
449− SETTY(cl, BITS32);
449+ SETTY(cl, CT_BITS32);
450 cl->info.bits32 = (uint32_t) (((int32_t) A) % ((int32_t) B));
450 cl->info.bits32 = (uint32_t) (((int32_t) A) % ((int32_t) B));
451 return cl;
451 return cl;
452}
452}
@@ -474,7 +474,7 @@ VAL idris_b32Gte(VM *vm, VAL a, VAL b) {
474VAL idris_b32Compl(VM *vm, VAL a) {
474VAL idris_b32Compl(VM *vm, VAL a) {
475 uint32_t A = a->info.bits32;
475 uint32_t A = a->info.bits32;
476 VAL cl = allocate(sizeof(Closure), 0);
476 VAL cl = allocate(sizeof(Closure), 0);
477− SETTY(cl, BITS32);
477+ SETTY(cl, CT_BITS32);
478 cl->info.bits32 = ~ A;
478 cl->info.bits32 = ~ A;
479 return cl;
479 return cl;
480}
480}
@@ -483,7 +483,7 @@ VAL idris_b32And(VM *vm, VAL a, VAL b) {
483 uint32_t A = a->info.bits32;
483 uint32_t A = a->info.bits32;
484 uint32_t B = b->info.bits32;
484 uint32_t B = b->info.bits32;
485 VAL cl = allocate(sizeof(Closure), 0);
485 VAL cl = allocate(sizeof(Closure), 0);
486− SETTY(cl, BITS32);
486+ SETTY(cl, CT_BITS32);
487 cl->info.bits32 = A & B;
487 cl->info.bits32 = A & B;
488 return cl;
488 return cl;
489}
489}
@@ -492,7 +492,7 @@ VAL idris_b32Or(VM *vm, VAL a, VAL b) {
492 uint32_t A = a->info.bits32;
492 uint32_t A = a->info.bits32;
493 uint32_t B = b->info.bits32;
493 uint32_t B = b->info.bits32;
494 VAL cl = allocate(sizeof(Closure), 0);
494 VAL cl = allocate(sizeof(Closure), 0);
495− SETTY(cl, BITS32);
495+ SETTY(cl, CT_BITS32);
496 cl->info.bits32 = A | B;
496 cl->info.bits32 = A | B;
497 return cl;
497 return cl;
498}
498}
@@ -501,7 +501,7 @@ VAL idris_b32Xor(VM *vm, VAL a, VAL b) {
501 uint32_t A = a->info.bits32;
501 uint32_t A = a->info.bits32;
502 uint32_t B = b->info.bits32;
502 uint32_t B = b->info.bits32;
503 VAL cl = allocate(sizeof(Closure), 0);
503 VAL cl = allocate(sizeof(Closure), 0);
504− SETTY(cl, BITS32);
504+ SETTY(cl, CT_BITS32);
505 cl->info.bits32 = A ^ B;
505 cl->info.bits32 = A ^ B;
506 return cl;
506 return cl;
507}
507}
@@ -510,7 +510,7 @@ VAL idris_b32Shl(VM *vm, VAL a, VAL b) {
510 uint32_t A = a->info.bits32;
510 uint32_t A = a->info.bits32;
511 uint32_t B = b->info.bits32;
511 uint32_t B = b->info.bits32;
512 VAL cl = allocate(sizeof(Closure), 0);
512 VAL cl = allocate(sizeof(Closure), 0);
513− SETTY(cl, BITS32);
513+ SETTY(cl, CT_BITS32);
514 cl->info.bits32 = A << B;
514 cl->info.bits32 = A << B;
515 return cl;
515 return cl;
516}
516}
@@ -519,7 +519,7 @@ VAL idris_b32LShr(VM *vm, VAL a, VAL b) {
519 uint32_t A = a->info.bits32;
519 uint32_t A = a->info.bits32;
520 uint32_t B = b->info.bits32;
520 uint32_t B = b->info.bits32;
521 VAL cl = allocate(sizeof(Closure), 0);
521 VAL cl = allocate(sizeof(Closure), 0);
522− SETTY(cl, BITS32);
522+ SETTY(cl, CT_BITS32);
523 cl->info.bits32 = A >> B;
523 cl->info.bits32 = A >> B;
524 return cl;
524 return cl;
525}
525}
@@ -528,7 +528,7 @@ VAL idris_b32AShr(VM *vm, VAL a, VAL b) {
528 uint32_t A = a->info.bits32;
528 uint32_t A = a->info.bits32;
529 uint32_t B = b->info.bits32;
529 uint32_t B = b->info.bits32;
530 VAL cl = allocate(sizeof(Closure), 0);
530 VAL cl = allocate(sizeof(Closure), 0);
531− SETTY(cl, BITS32);
531+ SETTY(cl, CT_BITS32);
532 cl->info.bits32 = (uint32_t) (((int32_t)A) >> ((int32_t)B));
532 cl->info.bits32 = (uint32_t) (((int32_t)A) >> ((int32_t)B));
533 return cl;
533 return cl;
534}
534}
@@ -537,7 +537,7 @@ VAL idris_b64Plus(VM *vm, VAL a, VAL b) {
537 uint64_t A = a->info.bits64;
537 uint64_t A = a->info.bits64;
538 uint64_t B = b->info.bits64;
538 uint64_t B = b->info.bits64;
539 VAL cl = allocate(sizeof(Closure), 0);
539 VAL cl = allocate(sizeof(Closure), 0);
540− SETTY(cl, BITS64);
540+ SETTY(cl, CT_BITS64);
541 cl->info.bits64 = A + B;
541 cl->info.bits64 = A + B;
542 return cl;
542 return cl;
543}
543}
@@ -546,7 +546,7 @@ VAL idris_b64Minus(VM *vm, VAL a, VAL b) {
546 uint64_t A = a->info.bits64;
546 uint64_t A = a->info.bits64;
547 uint64_t B = b->info.bits64;
547 uint64_t B = b->info.bits64;
548 VAL cl = allocate(sizeof(Closure), 0);
548 VAL cl = allocate(sizeof(Closure), 0);
549− SETTY(cl, BITS64);
549+ SETTY(cl, CT_BITS64);
550 cl->info.bits64 = A - B;
550 cl->info.bits64 = A - B;
551 return cl;
551 return cl;
552}
552}
@@ -555,7 +555,7 @@ VAL idris_b64Times(VM *vm, VAL a, VAL b) {
555 uint64_t A = a->info.bits64;
555 uint64_t A = a->info.bits64;
556 uint64_t B = b->info.bits64;
556 uint64_t B = b->info.bits64;
557 VAL cl = allocate(sizeof(Closure), 0);
557 VAL cl = allocate(sizeof(Closure), 0);
558− SETTY(cl, BITS64);
558+ SETTY(cl, CT_BITS64);
559 cl->info.bits64 = A * B;
559 cl->info.bits64 = A * B;
560 return cl;
560 return cl;
561}
561}
@@ -564,7 +564,7 @@ VAL idris_b64UDiv(VM *vm, VAL a, VAL b) {
564 uint64_t A = a->info.bits64;
564 uint64_t A = a->info.bits64;
565 uint64_t B = b->info.bits64;
565 uint64_t B = b->info.bits64;
566 VAL cl = allocate(sizeof(Closure), 0);
566 VAL cl = allocate(sizeof(Closure), 0);
567− SETTY(cl, BITS64);
567+ SETTY(cl, CT_BITS64);
568 cl->info.bits64 = A / B;
568 cl->info.bits64 = A / B;
569 return cl;
569 return cl;
570}
570}
@@ -573,7 +573,7 @@ VAL idris_b64SDiv(VM *vm, VAL a, VAL b) {
573 uint64_t A = a->info.bits64;
573 uint64_t A = a->info.bits64;
574 uint64_t B = b->info.bits64;
574 uint64_t B = b->info.bits64;
575 VAL cl = allocate(sizeof(Closure), 0);
575 VAL cl = allocate(sizeof(Closure), 0);
576− SETTY(cl, BITS64);
576+ SETTY(cl, CT_BITS64);
577 cl->info.bits64 = (uint64_t) (((int64_t) A) / ((int64_t) B));
577 cl->info.bits64 = (uint64_t) (((int64_t) A) / ((int64_t) B));
578 return cl;
578 return cl;
579}
579}
@@ -582,7 +582,7 @@ VAL idris_b64URem(VM *vm, VAL a, VAL b) {
582 uint64_t A = a->info.bits64;
582 uint64_t A = a->info.bits64;
583 uint64_t B = b->info.bits64;
583 uint64_t B = b->info.bits64;
584 VAL cl = allocate(sizeof(Closure), 0);
584 VAL cl = allocate(sizeof(Closure), 0);
585− SETTY(cl, BITS64);
585+ SETTY(cl, CT_BITS64);
586 cl->info.bits64 = A % B;
586 cl->info.bits64 = A % B;
587 return cl;
587 return cl;
588}
588}
@@ -591,7 +591,7 @@ VAL idris_b64SRem(VM *vm, VAL a, VAL b) {
591 uint64_t A = a->info.bits64;
591 uint64_t A = a->info.bits64;
592 uint64_t B = b->info.bits64;
592 uint64_t B = b->info.bits64;
593 VAL cl = allocate(sizeof(Closure), 0);
593 VAL cl = allocate(sizeof(Closure), 0);
594− SETTY(cl, BITS64);
594+ SETTY(cl, CT_BITS64);
595 cl->info.bits64 = (uint64_t) (((int64_t) A) % ((int64_t) B));
595 cl->info.bits64 = (uint64_t) (((int64_t) A) % ((int64_t) B));
596 return cl;
596 return cl;
597}
597}
@@ -619,7 +619,7 @@ VAL idris_b64Gte(VM *vm, VAL a, VAL b) {
619VAL idris_b64Compl(VM *vm, VAL a) {
619VAL idris_b64Compl(VM *vm, VAL a) {
620 uint64_t A = a->info.bits64;
620 uint64_t A = a->info.bits64;
621 VAL cl = allocate(sizeof(Closure), 0);
621 VAL cl = allocate(sizeof(Closure), 0);
622− SETTY(cl, BITS64);
622+ SETTY(cl, CT_BITS64);
623 cl->info.bits64 = ~ A;
623 cl->info.bits64 = ~ A;
624 return cl;
624 return cl;
625}
625}
@@ -628,7 +628,7 @@ VAL idris_b64And(VM *vm, VAL a, VAL b) {
628 uint64_t A = a->info.bits64;
628 uint64_t A = a->info.bits64;
629 uint64_t B = b->info.bits64;
629 uint64_t B = b->info.bits64;
630 VAL cl = allocate(sizeof(Closure), 0);
630 VAL cl = allocate(sizeof(Closure), 0);
631− SETTY(cl, BITS64);
631+ SETTY(cl, CT_BITS64);
632 cl->info.bits64 = A & B;
632 cl->info.bits64 = A & B;
633 return cl;
633 return cl;
634}
634}
@@ -637,7 +637,7 @@ VAL idris_b64Or(VM *vm, VAL a, VAL b) {
637 uint64_t A = a->info.bits64;
637 uint64_t A = a->info.bits64;
638 uint64_t B = b->info.bits64;
638 uint64_t B = b->info.bits64;
639 VAL cl = allocate(sizeof(Closure), 0);
639 VAL cl = allocate(sizeof(Closure), 0);
640− SETTY(cl, BITS64);
640+ SETTY(cl, CT_BITS64);
641 cl->info.bits64 = A | B;
641 cl->info.bits64 = A | B;
642 return cl;
642 return cl;
643}
643}
@@ -646,7 +646,7 @@ VAL idris_b64Xor(VM *vm, VAL a, VAL b) {
646 uint64_t A = a->info.bits64;
646 uint64_t A = a->info.bits64;
647 uint64_t B = b->info.bits64;
647 uint64_t B = b->info.bits64;
648 VAL cl = allocate(sizeof(Closure), 0);
648 VAL cl = allocate(sizeof(Closure), 0);
649− SETTY(cl, BITS64);
649+ SETTY(cl, CT_BITS64);
650 cl->info.bits64 = A ^ B;
650 cl->info.bits64 = A ^ B;
651 return cl;
651 return cl;
652}
652}
@@ -655,7 +655,7 @@ VAL idris_b64Shl(VM *vm, VAL a, VAL b) {
655 uint64_t A = a->info.bits64;
655 uint64_t A = a->info.bits64;
656 uint64_t B = b->info.bits64;
656 uint64_t B = b->info.bits64;
657 VAL cl = allocate(sizeof(Closure), 0);
657 VAL cl = allocate(sizeof(Closure), 0);
658− SETTY(cl, BITS64);
658+ SETTY(cl, CT_BITS64);
659 cl->info.bits64 = A << B;
659 cl->info.bits64 = A << B;
660 return cl;
660 return cl;
661}
661}
@@ -664,7 +664,7 @@ VAL idris_b64LShr(VM *vm, VAL a, VAL b) {
664 uint64_t A = a->info.bits64;
664 uint64_t A = a->info.bits64;
665 uint64_t B = b->info.bits64;
665 uint64_t B = b->info.bits64;
666 VAL cl = allocate(sizeof(Closure), 0);
666 VAL cl = allocate(sizeof(Closure), 0);
667− SETTY(cl, BITS64);
667+ SETTY(cl, CT_BITS64);
668 cl->info.bits64 = A >> B;
668 cl->info.bits64 = A >> B;
669 return cl;
669 return cl;
670}
670}
@@ -673,7 +673,7 @@ VAL idris_b64AShr(VM *vm, VAL a, VAL b) {
673 uint64_t A = a->info.bits64;
673 uint64_t A = a->info.bits64;
674 uint64_t B = b->info.bits64;
674 uint64_t B = b->info.bits64;
675 VAL cl = allocate(sizeof(Closure), 0);
675 VAL cl = allocate(sizeof(Closure), 0);
676− SETTY(cl, BITS64);
676+ SETTY(cl, CT_BITS64);
677 cl->info.bits64 = (uint64_t) (((int64_t) A) >> ((int64_t) B));
677 cl->info.bits64 = (uint64_t) (((int64_t) A) >> ((int64_t) B));
678 return cl;
678 return cl;
679}
679}
@@ -681,7 +681,7 @@ VAL idris_b64AShr(VM *vm, VAL a, VAL b) {
681VAL idris_b8Z16(VM *vm, VAL a) {
681VAL idris_b8Z16(VM *vm, VAL a) {
682 uint8_t A = a->info.bits8;
682 uint8_t A = a->info.bits8;
683 VAL cl = allocate(sizeof(Closure), 0);
683 VAL cl = allocate(sizeof(Closure), 0);
684− SETTY(cl, BITS16);
684+ SETTY(cl, CT_BITS16);
685 cl->info.bits16 = (uint16_t) A;
685 cl->info.bits16 = (uint16_t) A;
686 return cl;
686 return cl;
687}
687}
@@ -689,7 +689,7 @@ VAL idris_b8Z16(VM *vm, VAL a) {
689VAL idris_b8Z32(VM *vm, VAL a) {
689VAL idris_b8Z32(VM *vm, VAL a) {
690 uint8_t A = a->info.bits8;
690 uint8_t A = a->info.bits8;
691 VAL cl = allocate(sizeof(Closure), 0);
691 VAL cl = allocate(sizeof(Closure), 0);
692− SETTY(cl, BITS32);
692+ SETTY(cl, CT_BITS32);
693 cl->info.bits32 = (uint32_t) A;
693 cl->info.bits32 = (uint32_t) A;
694 return cl;
694 return cl;
695}
695}
@@ -697,7 +697,7 @@ VAL idris_b8Z32(VM *vm, VAL a) {
697VAL idris_b8Z64(VM *vm, VAL a) {
697VAL idris_b8Z64(VM *vm, VAL a) {
698 uint8_t A = a->info.bits8;
698 uint8_t A = a->info.bits8;
699 VAL cl = allocate(sizeof(Closure), 0);
699 VAL cl = allocate(sizeof(Closure), 0);
700− SETTY(cl, BITS64);
700+ SETTY(cl, CT_BITS64);
701 cl->info.bits64 = (uint64_t) A;
701 cl->info.bits64 = (uint64_t) A;
702 return cl;
702 return cl;
703}
703}
@@ -705,7 +705,7 @@ VAL idris_b8Z64(VM *vm, VAL a) {
705VAL idris_b8S16(VM *vm, VAL a) {
705VAL idris_b8S16(VM *vm, VAL a) {
706 uint8_t A = a->info.bits8;
706 uint8_t A = a->info.bits8;
707 VAL cl = allocate(sizeof(Closure), 0);
707 VAL cl = allocate(sizeof(Closure), 0);
708− SETTY(cl, BITS16);
708+ SETTY(cl, CT_BITS16);
709 cl->info.bits16 = (uint16_t) (int16_t) (int8_t) A;
709 cl->info.bits16 = (uint16_t) (int16_t) (int8_t) A;
710 return cl;
710 return cl;
711}
711}
@@ -713,7 +713,7 @@ VAL idris_b8S16(VM *vm, VAL a) {
713VAL idris_b8S32(VM *vm, VAL a) {
713VAL idris_b8S32(VM *vm, VAL a) {
714 uint8_t A = a->info.bits8;
714 uint8_t A = a->info.bits8;
715 VAL cl = allocate(sizeof(Closure), 0);
715 VAL cl = allocate(sizeof(Closure), 0);
716− SETTY(cl, BITS32);
716+ SETTY(cl, CT_BITS32);
717 cl->info.bits32 = (uint32_t) (int32_t) (int8_t) A;
717 cl->info.bits32 = (uint32_t) (int32_t) (int8_t) A;
718 return cl;
718 return cl;
719}
719}
@@ -721,7 +721,7 @@ VAL idris_b8S32(VM *vm, VAL a) {
721VAL idris_b8S64(VM *vm, VAL a) {
721VAL idris_b8S64(VM *vm, VAL a) {
722 uint8_t A = a->info.bits8;
722 uint8_t A = a->info.bits8;
723 VAL cl = allocate(sizeof(Closure), 0);
723 VAL cl = allocate(sizeof(Closure), 0);
724− SETTY(cl, BITS64);
724+ SETTY(cl, CT_BITS64);
725 cl->info.bits64 = (uint64_t) (int64_t) (int8_t) A;
725 cl->info.bits64 = (uint64_t) (int64_t) (int8_t) A;
726 return cl;
726 return cl;
727}
727}
@@ -729,7 +729,7 @@ VAL idris_b8S64(VM *vm, VAL a) {
729VAL idris_b16Z32(VM *vm, VAL a) {
729VAL idris_b16Z32(VM *vm, VAL a) {
730 uint16_t A = a->info.bits16;
730 uint16_t A = a->info.bits16;
731 VAL cl = allocate(sizeof(Closure), 0);
731 VAL cl = allocate(sizeof(Closure), 0);
732− SETTY(cl, BITS32);
732+ SETTY(cl, CT_BITS32);
733 cl->info.bits32 = (uint32_t) A;
733 cl->info.bits32 = (uint32_t) A;
734 return cl;
734 return cl;
735}
735}
@@ -737,7 +737,7 @@ VAL idris_b16Z32(VM *vm, VAL a) {
737VAL idris_b16Z64(VM *vm, VAL a) {
737VAL idris_b16Z64(VM *vm, VAL a) {
738 uint16_t A = a->info.bits16;
738 uint16_t A = a->info.bits16;
739 VAL cl = allocate(sizeof(Closure), 0);
739 VAL cl = allocate(sizeof(Closure), 0);
740− SETTY(cl, BITS64);
740+ SETTY(cl, CT_BITS64);
741 cl->info.bits64 = (uint64_t) A;
741 cl->info.bits64 = (uint64_t) A;
742 return cl;
742 return cl;
743}
743}
@@ -745,7 +745,7 @@ VAL idris_b16Z64(VM *vm, VAL a) {
745VAL idris_b16S32(VM *vm, VAL a) {
745VAL idris_b16S32(VM *vm, VAL a) {
746 uint16_t A = a->info.bits16;
746 uint16_t A = a->info.bits16;
747 VAL cl = allocate(sizeof(Closure), 0);
747 VAL cl = allocate(sizeof(Closure), 0);
748− SETTY(cl, BITS32);
748+ SETTY(cl, CT_BITS32);
749 cl->info.bits32 = (uint32_t) (int32_t) (int16_t) A;
749 cl->info.bits32 = (uint32_t) (int32_t) (int16_t) A;
750 return cl;
750 return cl;
751}
751}
@@ -753,7 +753,7 @@ VAL idris_b16S32(VM *vm, VAL a) {
753VAL idris_b16S64(VM *vm, VAL a) {
753VAL idris_b16S64(VM *vm, VAL a) {
754 uint16_t A = a->info.bits16;
754 uint16_t A = a->info.bits16;
755 VAL cl = allocate(sizeof(Closure), 0);
755 VAL cl = allocate(sizeof(Closure), 0);
756− SETTY(cl, BITS64);
756+ SETTY(cl, CT_BITS64);
757 cl->info.bits64 = (uint64_t) (int64_t) (int16_t) A;
757 cl->info.bits64 = (uint64_t) (int64_t) (int16_t) A;
758 return cl;
758 return cl;
759}
759}
@@ -761,7 +761,7 @@ VAL idris_b16S64(VM *vm, VAL a) {
761VAL idris_b16T8(VM *vm, VAL a) {
761VAL idris_b16T8(VM *vm, VAL a) {
762 uint16_t A = a->info.bits16;
762 uint16_t A = a->info.bits16;
763 VAL cl = allocate(sizeof(Closure), 0);
763 VAL cl = allocate(sizeof(Closure), 0);
764− SETTY(cl, BITS8);
764+ SETTY(cl, CT_BITS8);
765 cl->info.bits8 = (uint8_t) A;
765 cl->info.bits8 = (uint8_t) A;
766 return cl;
766 return cl;
767}
767}
@@ -769,7 +769,7 @@ VAL idris_b16T8(VM *vm, VAL a) {
769VAL idris_b32Z64(VM *vm, VAL a) {
769VAL idris_b32Z64(VM *vm, VAL a) {
770 uint32_t A = a->info.bits32;
770 uint32_t A = a->info.bits32;
771 VAL cl = allocate(sizeof(Closure), 0);
771 VAL cl = allocate(sizeof(Closure), 0);
772− SETTY(cl, BITS64);
772+ SETTY(cl, CT_BITS64);
773 cl->info.bits64 = (uint64_t) A;
773 cl->info.bits64 = (uint64_t) A;
774 return cl;
774 return cl;
775}
775}
@@ -777,7 +777,7 @@ VAL idris_b32Z64(VM *vm, VAL a) {
777VAL idris_b32S64(VM *vm, VAL a) {
777VAL idris_b32S64(VM *vm, VAL a) {
778 uint32_t A = a->info.bits32;
778 uint32_t A = a->info.bits32;
779 VAL cl = allocate(sizeof(Closure), 0);
779 VAL cl = allocate(sizeof(Closure), 0);
780− SETTY(cl, BITS64);
780+ SETTY(cl, CT_BITS64);
781 cl->info.bits64 = (uint64_t) (int64_t) (int32_t) A;
781 cl->info.bits64 = (uint64_t) (int64_t) (int32_t) A;
782 return cl;
782 return cl;
783}
783}
@@ -785,7 +785,7 @@ VAL idris_b32S64(VM *vm, VAL a) {
785VAL idris_b32T8(VM *vm, VAL a) {
785VAL idris_b32T8(VM *vm, VAL a) {
786 uint32_t A = a->info.bits32;
786 uint32_t A = a->info.bits32;
787 VAL cl = allocate(sizeof(Closure), 0);
787 VAL cl = allocate(sizeof(Closure), 0);
788− SETTY(cl, BITS8);
788+ SETTY(cl, CT_BITS8);
789 cl->info.bits8 = (uint8_t) A;
789 cl->info.bits8 = (uint8_t) A;
790 return cl;
790 return cl;
791}
791}
@@ -793,7 +793,7 @@ VAL idris_b32T8(VM *vm, VAL a) {
793VAL idris_b32T16(VM *vm, VAL a) {
793VAL idris_b32T16(VM *vm, VAL a) {
794 uint32_t A = a->info.bits32;
794 uint32_t A = a->info.bits32;
795 VAL cl = allocate(sizeof(Closure), 0);
795 VAL cl = allocate(sizeof(Closure), 0);
796− SETTY(cl, BITS16);
796+ SETTY(cl, CT_BITS16);
797 cl->info.bits16 = (uint16_t) A;
797 cl->info.bits16 = (uint16_t) A;
798 return cl;
798 return cl;
799}
799}
@@ -801,7 +801,7 @@ VAL idris_b32T16(VM *vm, VAL a) {
801VAL idris_b64T8(VM *vm, VAL a) {
801VAL idris_b64T8(VM *vm, VAL a) {
802 uint64_t A = a->info.bits64;
802 uint64_t A = a->info.bits64;
803 VAL cl = allocate(sizeof(Closure), 0);
803 VAL cl = allocate(sizeof(Closure), 0);
804− SETTY(cl, BITS8);
804+ SETTY(cl, CT_BITS8);
805 cl->info.bits8 = (uint8_t) A;
805 cl->info.bits8 = (uint8_t) A;
806 return cl;
806 return cl;
807}
807}
@@ -809,7 +809,7 @@ VAL idris_b64T8(VM *vm, VAL a) {
809VAL idris_b64T16(VM *vm, VAL a) {
809VAL idris_b64T16(VM *vm, VAL a) {
810 uint64_t A = a->info.bits64;
810 uint64_t A = a->info.bits64;
811 VAL cl = allocate(sizeof(Closure), 0);
811 VAL cl = allocate(sizeof(Closure), 0);
812− SETTY(cl, BITS16);
812+ SETTY(cl, CT_BITS16);
813 cl->info.bits16 = (uint16_t) A;
813 cl->info.bits16 = (uint16_t) A;
814 return cl;
814 return cl;
815}
815}
@@ -817,7 +817,7 @@ VAL idris_b64T16(VM *vm, VAL a) {
817VAL idris_b64T32(VM *vm, VAL a) {
817VAL idris_b64T32(VM *vm, VAL a) {
818 uint64_t A = a->info.bits64;
818 uint64_t A = a->info.bits64;
819 VAL cl = allocate(sizeof(Closure), 0);
819 VAL cl = allocate(sizeof(Closure), 0);
820− SETTY(cl, BITS32);
820+ SETTY(cl, CT_BITS32);
821 cl->info.bits32 = (uint32_t) A;
821 cl->info.bits32 = (uint32_t) A;
822 return cl;
822 return cl;
823}
823}
rts/idris_gc.c+18−18
@@ -10,7 +10,7 @@ VAL copy(VM* vm, VAL x) {
10 return x;
10 return x;
11 }
11 }
12 switch(GETTY(x)) {
12 switch(GETTY(x)) {
13− case CON:
13+ case CT_CON:
14 ar = CARITY(x);
14 ar = CARITY(x);
15 if (ar == 0 && CTAG(x) < 256) {
15 if (ar == 0 && CTAG(x) < 256) {
16 return x;
16 return x;
@@ -21,53 +21,53 @@ VAL copy(VM* vm, VAL x) {
21 }
21 }
22 }
22 }
23 break;
23 break;
24− case FLOAT:
24+ case CT_FLOAT:
25 cl = MKFLOATc(vm, x->info.f);
25 cl = MKFLOATc(vm, x->info.f);
26 break;
26 break;
27− case STRING:
27+ case CT_STRING:
28 cl = MKSTRc(vm, x->info.str);
28 cl = MKSTRc(vm, x->info.str);
29 break;
29 break;
30− case STROFFSET:
30+ case CT_STROFFSET:
31 cl = MKSTROFFc(vm, x->info.str_offset);
31 cl = MKSTROFFc(vm, x->info.str_offset);
32 break;
32 break;
33− case BIGINT:
33+ case CT_BIGINT:
34 cl = MKBIGMc(vm, x->info.ptr);
34 cl = MKBIGMc(vm, x->info.ptr);
35 break;
35 break;
36− case PTR:
36+ case CT_PTR:
37 cl = MKPTRc(vm, x->info.ptr);
37 cl = MKPTRc(vm, x->info.ptr);
38 break;
38 break;
39− case MANAGEDPTR:
39+ case CT_MANAGEDPTR:
40 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
40 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
41 break;
41 break;
42− case BITS8:
42+ case CT_BITS8:
43 cl = idris_b8CopyForGC(vm, x);
43 cl = idris_b8CopyForGC(vm, x);
44 break;
44 break;
45− case BITS16:
45+ case CT_BITS16:
46 cl = idris_b16CopyForGC(vm, x);
46 cl = idris_b16CopyForGC(vm, x);
47 break;
47 break;
48− case BITS32:
48+ case CT_BITS32:
49 cl = idris_b32CopyForGC(vm, x);
49 cl = idris_b32CopyForGC(vm, x);
50 break;
50 break;
51− case BITS64:
51+ case CT_BITS64:
52 cl = idris_b64CopyForGC(vm, x);
52 cl = idris_b64CopyForGC(vm, x);
53 break;
53 break;
54− case FWD:
54+ case CT_FWD:
55 return x->info.ptr;
55 return x->info.ptr;
56− case RAWDATA:
56+ case CT_RAWDATA:
57 {
57 {
58 size_t size = x->info.size + sizeof(Closure);
58 size_t size = x->info.size + sizeof(Closure);
59 cl = allocate(size, 0);
59 cl = allocate(size, 0);
60 memcpy(cl, x, size);
60 memcpy(cl, x, size);
61 }
61 }
62 break;
62 break;
63− case CDATA:
63+ case CT_CDATA:
64 cl = MKCDATAc(vm, x->info.c_heap_item);
64 cl = MKCDATAc(vm, x->info.c_heap_item);
65 c_heap_mark_item(x->info.c_heap_item);
65 c_heap_mark_item(x->info.c_heap_item);
66 break;
66 break;
67 default:
67 default:
68 break;
68 break;
69 }
69 }
70− SETTY(x, FWD);
70+ SETTY(x, CT_FWD);
71 x->info.ptr = cl;
71 x->info.ptr = cl;
72 return cl;
72 return cl;
73}
73}
@@ -80,16 +80,16 @@ void cheney(VM *vm) {
80 while(scan < vm->heap.next) {
80 while(scan < vm->heap.next) {
81 size_t inc = *((size_t*)scan);
81 size_t inc = *((size_t*)scan);
82 VAL heap_item = (VAL)(scan+sizeof(size_t));
82 VAL heap_item = (VAL)(scan+sizeof(size_t));
83− // If it's a CON or STROFFSET, copy its arguments
83+ // If it's a CT_CON or CT_STROFFSET, copy its arguments
84 switch(GETTY(heap_item)) {
84 switch(GETTY(heap_item)) {
85− case CON:
85+ case CT_CON:
86 ar = ARITY(heap_item);
86 ar = ARITY(heap_item);
87 for(i = 0; i < ar; ++i) {
87 for(i = 0; i < ar; ++i) {
88 VAL newptr = copy(vm, heap_item->info.c.args[i]);
88 VAL newptr = copy(vm, heap_item->info.c.args[i]);
89 heap_item->info.c.args[i] = newptr;
89 heap_item->info.c.args[i] = newptr;
90 }
90 }
91 break;
91 break;
92− case STROFFSET:
92+ case CT_STROFFSET:
93 heap_item->info.str_offset->str
93 heap_item->info.str_offset->str
94 = copy(vm, heap_item->info.str_offset->str);
94 = copy(vm, heap_item->info.str_offset->str);
95 break;
95 break;
rts/idris_gmp.c+18−18
@@ -33,7 +33,7 @@ VAL MKBIGC(VM* vm, char* val) {
33 mpz_init(*bigint);
33 mpz_init(*bigint);
34 mpz_set_str(*bigint, val, 10);
34 mpz_set_str(*bigint, val, 10);
35
35
36− SETTY(cl, BIGINT);
36+ SETTY(cl, CT_BIGINT);
37 cl -> info.ptr = (void*)bigint;
37 cl -> info.ptr = (void*)bigint;
38
38
39 return cl;
39 return cl;
@@ -50,7 +50,7 @@ VAL MKBIGM(VM* vm, void* big) {
50 mpz_init(*bigint);
50 mpz_init(*bigint);
51 mpz_set(*bigint, *((mpz_t*)big));
51 mpz_set(*bigint, *((mpz_t*)big));
52
52
53− SETTY(cl, BIGINT);
53+ SETTY(cl, CT_BIGINT);
54 cl -> info.ptr = (void*)bigint;
54 cl -> info.ptr = (void*)bigint;
55
55
56 return cl;
56 return cl;
@@ -66,7 +66,7 @@ VAL MKBIGMc(VM* vm, void* big) {
66
66
67 mpz_init_set(*bigint, *((mpz_t*)big));
67 mpz_init_set(*bigint, *((mpz_t*)big));
68
68
69− SETTY(cl, BIGINT);
69+ SETTY(cl, CT_BIGINT);
70 cl -> info.ptr = (void*)bigint;
70 cl -> info.ptr = (void*)bigint;
71
71
72 return cl;
72 return cl;
@@ -82,7 +82,7 @@ VAL MKBIGUI(VM* vm, unsigned long val) {
82
82
83 mpz_init_set_ui(*bigint, val);
83 mpz_init_set_ui(*bigint, val);
84
84
85− SETTY(cl, BIGINT);
85+ SETTY(cl, CT_BIGINT);
86 cl -> info.ptr = (void*)bigint;
86 cl -> info.ptr = (void*)bigint;
87
87
88 return cl;
88 return cl;
@@ -98,7 +98,7 @@ VAL MKBIGSI(VM* vm, signed long val) {
98
98
99 mpz_init_set_si(*bigint, val);
99 mpz_init_set_si(*bigint, val);
100
100
101− SETTY(cl, BIGINT);
101+ SETTY(cl, CT_BIGINT);
102 cl -> info.ptr = (void*)bigint;
102 cl -> info.ptr = (void*)bigint;
103
103
104 return cl;
104 return cl;
@@ -116,14 +116,14 @@ VAL GETBIG(VM * vm, VAL x) {
116 mpz_init(*bigint);
116 mpz_init(*bigint);
117 mpz_set_si(*bigint, GETINT(x));
117 mpz_set_si(*bigint, GETINT(x));
118
118
119− SETTY(cl, BIGINT);
119+ SETTY(cl, CT_BIGINT);
120 cl -> info.ptr = (void*)bigint;
120 cl -> info.ptr = (void*)bigint;
121
121
122 return cl;
122 return cl;
123 } else {
123 } else {
124 idris_doneAlloc();
124 idris_doneAlloc();
125 switch(GETTY(x)) {
125 switch(GETTY(x)) {
126− case FWD:
126+ case CT_FWD:
127 return GETBIG(vm, x->info.ptr);
127 return GETBIG(vm, x->info.ptr);
128 default:
128 default:
129 return x;
129 return x;
@@ -139,7 +139,7 @@ VAL bigAdd(VM* vm, VAL x, VAL y) {
139 idris_doneAlloc();
139 idris_doneAlloc();
140 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
140 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
141 mpz_add(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
141 mpz_add(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
142− SETTY(cl, BIGINT);
142+ SETTY(cl, CT_BIGINT);
143 cl -> info.ptr = (void*)bigint;
143 cl -> info.ptr = (void*)bigint;
144 return cl;
144 return cl;
145}
145}
@@ -152,7 +152,7 @@ VAL bigSub(VM* vm, VAL x, VAL y) {
152 idris_doneAlloc();
152 idris_doneAlloc();
153 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
153 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
154 mpz_sub(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
154 mpz_sub(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
155− SETTY(cl, BIGINT);
155+ SETTY(cl, CT_BIGINT);
156 cl -> info.ptr = (void*)bigint;
156 cl -> info.ptr = (void*)bigint;
157 return cl;
157 return cl;
158}
158}
@@ -165,7 +165,7 @@ VAL bigMul(VM* vm, VAL x, VAL y) {
165 idris_doneAlloc();
165 idris_doneAlloc();
166 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
166 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
167 mpz_mul(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
167 mpz_mul(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
168− SETTY(cl, BIGINT);
168+ SETTY(cl, CT_BIGINT);
169 cl -> info.ptr = (void*)bigint;
169 cl -> info.ptr = (void*)bigint;
170 return cl;
170 return cl;
171}
171}
@@ -178,7 +178,7 @@ VAL bigDiv(VM* vm, VAL x, VAL y) {
178 idris_doneAlloc();
178 idris_doneAlloc();
179 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
179 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
180 mpz_tdiv_q(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
180 mpz_tdiv_q(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
181− SETTY(cl, BIGINT);
181+ SETTY(cl, CT_BIGINT);
182 cl -> info.ptr = (void*)bigint;
182 cl -> info.ptr = (void*)bigint;
183 return cl;
183 return cl;
184}
184}
@@ -191,7 +191,7 @@ VAL bigMod(VM* vm, VAL x, VAL y) {
191 idris_doneAlloc();
191 idris_doneAlloc();
192 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
192 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
193 mpz_mod(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
193 mpz_mod(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
194− SETTY(cl, BIGINT);
194+ SETTY(cl, CT_BIGINT);
195 cl -> info.ptr = (void*)bigint;
195 cl -> info.ptr = (void*)bigint;
196 return cl;
196 return cl;
197}
197}
@@ -204,7 +204,7 @@ VAL bigAnd(VM* vm, VAL x, VAL y) {
204 idris_doneAlloc();
204 idris_doneAlloc();
205 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
205 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
206 mpz_and(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
206 mpz_and(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
207− SETTY(cl, BIGINT);
207+ SETTY(cl, CT_BIGINT);
208 cl -> info.ptr = (void*)bigint;
208 cl -> info.ptr = (void*)bigint;
209 return cl;
209 return cl;
210}
210}
@@ -217,7 +217,7 @@ VAL bigOr(VM* vm, VAL x, VAL y) {
217 idris_doneAlloc();
217 idris_doneAlloc();
218 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
218 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
219 mpz_ior(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
219 mpz_ior(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
220− SETTY(cl, BIGINT);
220+ SETTY(cl, CT_BIGINT);
221 cl -> info.ptr = (void*)bigint;
221 cl -> info.ptr = (void*)bigint;
222 return cl;
222 return cl;
223}
223}
@@ -230,7 +230,7 @@ VAL bigShiftLeft(VM* vm, VAL x, VAL y) {
230 idris_doneAlloc();
230 idris_doneAlloc();
231 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
231 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
232 mpz_mul_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
232 mpz_mul_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
233− SETTY(cl, BIGINT);
233+ SETTY(cl, CT_BIGINT);
234 cl -> info.ptr = (void*)bigint;
234 cl -> info.ptr = (void*)bigint;
235 return cl;
235 return cl;
236}
236}
@@ -244,7 +244,7 @@ VAL bigLShiftRight(VM* vm, VAL x, VAL y) {
244 idris_doneAlloc();
244 idris_doneAlloc();
245 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
245 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
246 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
246 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
247− SETTY(cl, BIGINT);
247+ SETTY(cl, CT_BIGINT);
248 cl -> info.ptr = (void*)bigint;
248 cl -> info.ptr = (void*)bigint;
249 return cl;
249 return cl;
250}
250}
@@ -257,7 +257,7 @@ VAL bigAShiftRight(VM* vm, VAL x, VAL y) {
257 idris_doneAlloc();
257 idris_doneAlloc();
258 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
258 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
259 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
259 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
260− SETTY(cl, BIGINT);
260+ SETTY(cl, CT_BIGINT);
261 cl -> info.ptr = (void*)bigint;
261 cl -> info.ptr = (void*)bigint;
262 return cl;
262 return cl;
263}
263}
@@ -473,7 +473,7 @@ VAL idris_castFloatBig(VM* vm, VAL f) {
473
473
474 mpz_init_set_d(*bigint, val);
474 mpz_init_set_d(*bigint, val);
475
475
476− SETTY(cl, BIGINT);
476+ SETTY(cl, CT_BIGINT);
477 cl -> info.ptr = (void*)bigint;
477 cl -> info.ptr = (void*)bigint;
478
478
479 return cl;
479 return cl;
rts/idris_heap.c+4−4
@@ -186,7 +186,7 @@ void heap_check_pointers(Heap * heap) {
186 VAL heap_item = (VAL)(scan + sizeof(size_t));
186 VAL heap_item = (VAL)(scan + sizeof(size_t));
187
187
188 switch(GETTY(heap_item)) {
188 switch(GETTY(heap_item)) {
189− case CON:
189+ case CT_CON:
190 {
190 {
191 int ar = ARITY(heap_item);
191 int ar = ARITY(heap_item);
192 int i = 0;
192 int i = 0;
@@ -207,7 +207,7 @@ void heap_check_pointers(Heap * heap) {
207 if (!(ptr < heap_item)) {
207 if (!(ptr < heap_item)) {
208 fprintf(stderr,
208 fprintf(stderr,
209 "RTS ERROR: heap unidirectionality broken:" \
209 "RTS ERROR: heap unidirectionality broken:" \
210− "<CON %p> <FIELD %p>\n",
210+ "<CT_CON %p> <FIELD %p>\n",
211 heap_item, ptr);
211 heap_item, ptr);
212 exit(EXIT_FAILURE);
212 exit(EXIT_FAILURE);
213 }
213 }
@@ -216,9 +216,9 @@ void heap_check_pointers(Heap * heap) {
216 }
216 }
217 break;
217 break;
218 }
218 }
219− case FWD:
219+ case CT_FWD:
220 // Check for artifacts after cheney gc.
220 // Check for artifacts after cheney gc.
221− fprintf(stderr, "RTS ERROR: FWD in working heap.\n");
221+ fprintf(stderr, "RTS ERROR: CT_FWD in working heap.\n");
222 exit(EXIT_FAILURE);
222 exit(EXIT_FAILURE);
223 break;
223 break;
224 default:
224 default:
rts/idris_rts.c+46−46
@@ -180,7 +180,7 @@ int space(VM* vm, size_t size) {
180
180
181void* idris_alloc(size_t size) {
181void* idris_alloc(size_t size) {
182 Closure* cl = (Closure*) allocate(sizeof(Closure)+size, 0);
182 Closure* cl = (Closure*) allocate(sizeof(Closure)+size, 0);
183− SETTY(cl, RAWDATA);
183+ SETTY(cl, CT_RAWDATA);
184 cl->info.size = size;
184 cl->info.size = size;
185 return (void*)cl+sizeof(Closure);
185 return (void*)cl+sizeof(Closure);
186}
186}
@@ -245,7 +245,7 @@ void* allocate(size_t size, int outerlock) {
245void* allocCon(VM* vm, int arity, int outer) {
245void* allocCon(VM* vm, int arity, int outer) {
246 Closure* cl = allocate(vm, sizeof(Closure) + sizeof(VAL)*arity,
246 Closure* cl = allocate(vm, sizeof(Closure) + sizeof(VAL)*arity,
247 outer);
247 outer);
248− SETTY(cl, CON);
248+ SETTY(cl, CT_CON);
249
249
250 cl -> info.c.arity = arity;
250 cl -> info.c.arity = arity;
251// cl -> info.c.tag = 42424242;
251// cl -> info.c.tag = 42424242;
@@ -256,7 +256,7 @@ void* allocCon(VM* vm, int arity, int outer) {
256
256
257VAL MKFLOAT(VM* vm, double val) {
257VAL MKFLOAT(VM* vm, double val) {
258 Closure* cl = allocate(sizeof(Closure), 0);
258 Closure* cl = allocate(sizeof(Closure), 0);
259− SETTY(cl, FLOAT);
259+ SETTY(cl, CT_FLOAT);
260 cl -> info.f = val;
260 cl -> info.f = val;
261 return cl;
261 return cl;
262}
262}
@@ -270,7 +270,7 @@ VAL MKSTR(VM* vm, const char* str) {
270 }
270 }
271 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
271 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
272 sizeof(char)*len, 0);
272 sizeof(char)*len, 0);
273− SETTY(cl, STRING);
273+ SETTY(cl, CT_STRING);
274 cl -> info.str = (char*)cl + sizeof(Closure);
274 cl -> info.str = (char*)cl + sizeof(Closure);
275 if (str == NULL) {
275 if (str == NULL) {
276 cl->info.str = NULL;
276 cl->info.str = NULL;
@@ -289,7 +289,7 @@ char* GETSTROFF(VAL stroff) {
289VAL MKCDATA(VM* vm, CHeapItem * item) {
289VAL MKCDATA(VM* vm, CHeapItem * item) {
290 c_heap_insert_if_needed(vm, &vm->c_heap, item);
290 c_heap_insert_if_needed(vm, &vm->c_heap, item);
291 Closure* cl = allocate(sizeof(Closure), 0);
291 Closure* cl = allocate(sizeof(Closure), 0);
292− SETTY(cl, CDATA);
292+ SETTY(cl, CT_CDATA);
293 cl->info.c_heap_item = item;
293 cl->info.c_heap_item = item;
294 return cl;
294 return cl;
295}
295}
@@ -297,14 +297,14 @@ VAL MKCDATA(VM* vm, CHeapItem * item) {
297VAL MKCDATAc(VM* vm, CHeapItem * item) {
297VAL MKCDATAc(VM* vm, CHeapItem * item) {
298 c_heap_insert_if_needed(vm, &vm->c_heap, item);
298 c_heap_insert_if_needed(vm, &vm->c_heap, item);
299 Closure* cl = allocate(sizeof(Closure), 1);
299 Closure* cl = allocate(sizeof(Closure), 1);
300− SETTY(cl, CDATA);
300+ SETTY(cl, CT_CDATA);
301 cl->info.c_heap_item = item;
301 cl->info.c_heap_item = item;
302 return cl;
302 return cl;
303}
303}
304
304
305VAL MKPTR(VM* vm, void* ptr) {
305VAL MKPTR(VM* vm, void* ptr) {
306 Closure* cl = allocate(sizeof(Closure), 0);
306 Closure* cl = allocate(sizeof(Closure), 0);
307− SETTY(cl, PTR);
307+ SETTY(cl, CT_PTR);
308 cl -> info.ptr = ptr;
308 cl -> info.ptr = ptr;
309 return cl;
309 return cl;
310}
310}
@@ -312,7 +312,7 @@ VAL MKPTR(VM* vm, void* ptr) {
312VAL MKMPTR(VM* vm, void* ptr, size_t size) {
312VAL MKMPTR(VM* vm, void* ptr, size_t size) {
313 Closure* cl = allocate(sizeof(Closure) +
313 Closure* cl = allocate(sizeof(Closure) +
314 sizeof(ManagedPtr) + size, 0);
314 sizeof(ManagedPtr) + size, 0);
315− SETTY(cl, MANAGEDPTR);
315+ SETTY(cl, CT_MANAGEDPTR);
316 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
316 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
317 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
317 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
318 memcpy(cl->info.mptr->data, ptr, size);
318 memcpy(cl->info.mptr->data, ptr, size);
@@ -322,7 +322,7 @@ VAL MKMPTR(VM* vm, void* ptr, size_t size) {
322
322
323VAL MKFLOATc(VM* vm, double val) {
323VAL MKFLOATc(VM* vm, double val) {
324 Closure* cl = allocate(sizeof(Closure), 1);
324 Closure* cl = allocate(sizeof(Closure), 1);
325− SETTY(cl, FLOAT);
325+ SETTY(cl, CT_FLOAT);
326 cl -> info.f = val;
326 cl -> info.f = val;
327 return cl;
327 return cl;
328}
328}
@@ -330,7 +330,7 @@ VAL MKFLOATc(VM* vm, double val) {
330VAL MKSTRc(VM* vm, char* str) {
330VAL MKSTRc(VM* vm, char* str) {
331 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
331 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
332 sizeof(char)*strlen(str)+1, 1);
332 sizeof(char)*strlen(str)+1, 1);
333− SETTY(cl, STRING);
333+ SETTY(cl, CT_STRING);
334 cl -> info.str = (char*)cl + sizeof(Closure);
334 cl -> info.str = (char*)cl + sizeof(Closure);
335
335
336 strcpy(cl -> info.str, str);
336 strcpy(cl -> info.str, str);
@@ -339,7 +339,7 @@ VAL MKSTRc(VM* vm, char* str) {
339
339
340VAL MKPTRc(VM* vm, void* ptr) {
340VAL MKPTRc(VM* vm, void* ptr) {
341 Closure* cl = allocate(sizeof(Closure), 1);
341 Closure* cl = allocate(sizeof(Closure), 1);
342− SETTY(cl, PTR);
342+ SETTY(cl, CT_PTR);
343 cl -> info.ptr = ptr;
343 cl -> info.ptr = ptr;
344 return cl;
344 return cl;
345}
345}
@@ -347,7 +347,7 @@ VAL MKPTRc(VM* vm, void* ptr) {
347VAL MKMPTRc(VM* vm, void* ptr, size_t size) {
347VAL MKMPTRc(VM* vm, void* ptr, size_t size) {
348 Closure* cl = allocate(sizeof(Closure) +
348 Closure* cl = allocate(sizeof(Closure) +
349 sizeof(ManagedPtr) + size, 1);
349 sizeof(ManagedPtr) + size, 1);
350− SETTY(cl, MANAGEDPTR);
350+ SETTY(cl, CT_MANAGEDPTR);
351 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
351 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
352 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
352 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
353 memcpy(cl->info.mptr->data, ptr, size);
353 memcpy(cl->info.mptr->data, ptr, size);
@@ -357,28 +357,28 @@ VAL MKMPTRc(VM* vm, void* ptr, size_t size) {
357
357
358VAL MKB8(VM* vm, uint8_t bits8) {
358VAL MKB8(VM* vm, uint8_t bits8) {
359 Closure* cl = allocate(sizeof(Closure), 1);
359 Closure* cl = allocate(sizeof(Closure), 1);
360− SETTY(cl, BITS8);
360+ SETTY(cl, CT_BITS8);
361 cl -> info.bits8 = bits8;
361 cl -> info.bits8 = bits8;
362 return cl;
362 return cl;
363}
363}
364
364
365VAL MKB16(VM* vm, uint16_t bits16) {
365VAL MKB16(VM* vm, uint16_t bits16) {
366 Closure* cl = allocate(sizeof(Closure), 1);
366 Closure* cl = allocate(sizeof(Closure), 1);
367− SETTY(cl, BITS16);
367+ SETTY(cl, CT_BITS16);
368 cl -> info.bits16 = bits16;
368 cl -> info.bits16 = bits16;
369 return cl;
369 return cl;
370}
370}
371
371
372VAL MKB32(VM* vm, uint32_t bits32) {
372VAL MKB32(VM* vm, uint32_t bits32) {
373 Closure* cl = allocate(sizeof(Closure), 1);
373 Closure* cl = allocate(sizeof(Closure), 1);
374− SETTY(cl, BITS32);
374+ SETTY(cl, CT_BITS32);
375 cl -> info.bits32 = bits32;
375 cl -> info.bits32 = bits32;
376 return cl;
376 return cl;
377}
377}
378
378
379VAL MKB64(VM* vm, uint64_t bits64) {
379VAL MKB64(VM* vm, uint64_t bits64) {
380 Closure* cl = allocate(sizeof(Closure), 1);
380 Closure* cl = allocate(sizeof(Closure), 1);
381− SETTY(cl, BITS64);
381+ SETTY(cl, CT_BITS64);
382 cl -> info.bits64 = bits64;
382 cl -> info.bits64 = bits64;
383 return cl;
383 return cl;
384}
384}
@@ -420,18 +420,18 @@ void dumpVal(VAL v) {
420 return;
420 return;
421 }
421 }
422 switch(GETTY(v)) {
422 switch(GETTY(v)) {
423− case CON:
423+ case CT_CON:
424 printf("%d[", TAG(v));
424 printf("%d[", TAG(v));
425 for(i = 0; i < ARITY(v); ++i) {
425 for(i = 0; i < ARITY(v); ++i) {
426 dumpVal(v->info.c.args[i]);
426 dumpVal(v->info.c.args[i]);
427 }
427 }
428 printf("] ");
428 printf("] ");
429 break;
429 break;
430− case STRING:
430+ case CT_STRING:
431 printf("STR[%s]", v->info.str);
431 printf("STR[%s]", v->info.str);
432 break;
432 break;
433− case FWD:
433+ case CT_FWD:
434− printf("FWD ");
434+ printf("CT_FWD ");
435 dumpVal((VAL)(v->info.ptr));
435 dumpVal((VAL)(v->info.ptr));
436 break;
436 break;
437 default:
437 default:
@@ -489,7 +489,7 @@ void idris_memmove(void* dest, void* src, i_int dest_offset, i_int src_offset, i
489VAL idris_castIntStr(VM* vm, VAL i) {
489VAL idris_castIntStr(VM* vm, VAL i) {
490 int x = (int) GETINT(i);
490 int x = (int) GETINT(i);
491 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*16, 0);
491 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*16, 0);
492− SETTY(cl, STRING);
492+ SETTY(cl, CT_STRING);
493 cl -> info.str = (char*)cl + sizeof(Closure);
493 cl -> info.str = (char*)cl + sizeof(Closure);
494 sprintf(cl -> info.str, "%d", x);
494 sprintf(cl -> info.str, "%d", x);
495 return cl;
495 return cl;
@@ -500,25 +500,25 @@ VAL idris_castBitsStr(VM* vm, VAL i) {
500 ClosureType ty = i->ty;
500 ClosureType ty = i->ty;
501
501
502 switch (ty) {
502 switch (ty) {
503− case BITS8:
503+ case CT_BITS8:
504 // max length 8 bit unsigned int str 3 chars (256)
504 // max length 8 bit unsigned int str 3 chars (256)
505 cl = allocate(sizeof(Closure) + sizeof(char)*4, 0);
505 cl = allocate(sizeof(Closure) + sizeof(char)*4, 0);
506 cl->info.str = (char*)cl + sizeof(Closure);
506 cl->info.str = (char*)cl + sizeof(Closure);
507 sprintf(cl->info.str, "%" PRIu8, (uint8_t)i->info.bits8);
507 sprintf(cl->info.str, "%" PRIu8, (uint8_t)i->info.bits8);
508 break;
508 break;
509− case BITS16:
509+ case CT_BITS16:
510 // max length 16 bit unsigned int str 5 chars (65,535)
510 // max length 16 bit unsigned int str 5 chars (65,535)
511 cl = allocate(sizeof(Closure) + sizeof(char)*6, 0);
511 cl = allocate(sizeof(Closure) + sizeof(char)*6, 0);
512 cl->info.str = (char*)cl + sizeof(Closure);
512 cl->info.str = (char*)cl + sizeof(Closure);
513 sprintf(cl->info.str, "%" PRIu16, (uint16_t)i->info.bits16);
513 sprintf(cl->info.str, "%" PRIu16, (uint16_t)i->info.bits16);
514 break;
514 break;
515− case BITS32:
515+ case CT_BITS32:
516 // max length 32 bit unsigned int str 10 chars (4,294,967,295)
516 // max length 32 bit unsigned int str 10 chars (4,294,967,295)
517 cl = allocate(sizeof(Closure) + sizeof(char)*11, 0);
517 cl = allocate(sizeof(Closure) + sizeof(char)*11, 0);
518 cl->info.str = (char*)cl + sizeof(Closure);
518 cl->info.str = (char*)cl + sizeof(Closure);
519 sprintf(cl->info.str, "%" PRIu32, (uint32_t)i->info.bits32);
519 sprintf(cl->info.str, "%" PRIu32, (uint32_t)i->info.bits32);
520 break;
520 break;
521− case BITS64:
521+ case CT_BITS64:
522 // max length 64 bit unsigned int str 20 chars (18,446,744,073,709,551,615)
522 // max length 64 bit unsigned int str 20 chars (18,446,744,073,709,551,615)
523 cl = allocate(sizeof(Closure) + sizeof(char)*21, 0);
523 cl = allocate(sizeof(Closure) + sizeof(char)*21, 0);
524 cl->info.str = (char*)cl + sizeof(Closure);
524 cl->info.str = (char*)cl + sizeof(Closure);
@@ -529,7 +529,7 @@ VAL idris_castBitsStr(VM* vm, VAL i) {
529 exit(EXIT_FAILURE);
529 exit(EXIT_FAILURE);
530 }
530 }
531
531
532− SETTY(cl, STRING);
532+ SETTY(cl, CT_STRING);
533 return cl;
533 return cl;
534}
534}
535
535
@@ -544,7 +544,7 @@ VAL idris_castStrInt(VM* vm, VAL i) {
544
544
545VAL idris_castFloatStr(VM* vm, VAL i) {
545VAL idris_castFloatStr(VM* vm, VAL i) {
546 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*32, 0);
546 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*32, 0);
547− SETTY(cl, STRING);
547+ SETTY(cl, CT_STRING);
548 cl -> info.str = (char*)cl + sizeof(Closure);
548 cl -> info.str = (char*)cl + sizeof(Closure);
549 snprintf(cl -> info.str, 32, "%.16g", GETFLOAT(i));
549 snprintf(cl -> info.str, 32, "%.16g", GETFLOAT(i));
550 return cl;
550 return cl;
@@ -560,7 +560,7 @@ VAL idris_concat(VM* vm, VAL l, VAL r) {
560 // dumpVal(l);
560 // dumpVal(l);
561 // printf("\n");
561 // printf("\n");
562 Closure* cl = allocate(sizeof(Closure) + strlen(ls) + strlen(rs) + 1, 0);
562 Closure* cl = allocate(sizeof(Closure) + strlen(ls) + strlen(rs) + 1, 0);
563− SETTY(cl, STRING);
563+ SETTY(cl, CT_STRING);
564 cl -> info.str = (char*)cl + sizeof(Closure);
564 cl -> info.str = (char*)cl + sizeof(Closure);
565 strcpy(cl -> info.str, ls);
565 strcpy(cl -> info.str, ls);
566 strcat(cl -> info.str, rs);
566 strcat(cl -> info.str, rs);
@@ -606,7 +606,7 @@ VAL idris_strHead(VM* vm, VAL str) {
606
606
607VAL MKSTROFFc(VM* vm, StrOffset* off) {
607VAL MKSTROFFc(VM* vm, StrOffset* off) {
608 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 1);
608 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 1);
609− SETTY(cl, STROFFSET);
609+ SETTY(cl, CT_STROFFSET);
610 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
610 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
611
611
612 cl->info.str_offset->str = off->str;
612 cl->info.str_offset->str = off->str;
@@ -620,7 +620,7 @@ VAL idris_strTail(VM* vm, VAL str) {
620 // gc moves str
620 // gc moves str
621 if (space(vm, sizeof(Closure) + sizeof(StrOffset))) {
621 if (space(vm, sizeof(Closure) + sizeof(StrOffset))) {
622 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 0);
622 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 0);
623− SETTY(cl, STROFFSET);
623+ SETTY(cl, CT_STROFFSET);
624 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
624 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
625
625
626 int offset = 0;
626 int offset = 0;
@@ -648,7 +648,7 @@ VAL idris_strCons(VM* vm, VAL x, VAL xs) {
648 if ((xval & 0x80) == 0) { // ASCII char
648 if ((xval & 0x80) == 0) { // ASCII char
649 Closure* cl = allocate(sizeof(Closure) +
649 Closure* cl = allocate(sizeof(Closure) +
650 strlen(xstr) + 2, 0);
650 strlen(xstr) + 2, 0);
651− SETTY(cl, STRING);
651+ SETTY(cl, CT_STRING);
652 cl -> info.str = (char*)cl + sizeof(Closure);
652 cl -> info.str = (char*)cl + sizeof(Closure);
653 cl -> info.str[0] = (char)(GETINT(x));
653 cl -> info.str[0] = (char)(GETINT(x));
654 strcpy(cl -> info.str+1, xstr);
654 strcpy(cl -> info.str+1, xstr);
@@ -656,7 +656,7 @@ VAL idris_strCons(VM* vm, VAL x, VAL xs) {
656 } else {
656 } else {
657 char *init = idris_utf8_fromChar(xval);
657 char *init = idris_utf8_fromChar(xval);
658 Closure* cl = allocate(sizeof(Closure) + strlen(init) + strlen(xstr) + 1, 0);
658 Closure* cl = allocate(sizeof(Closure) + strlen(init) + strlen(xstr) + 1, 0);
659− SETTY(cl, STRING);
659+ SETTY(cl, CT_STRING);
660 cl -> info.str = (char*)cl + sizeof(Closure);
660 cl -> info.str = (char*)cl + sizeof(Closure);
661 strcpy(cl -> info.str, init);
661 strcpy(cl -> info.str, init);
662 strcat(cl -> info.str, xstr);
662 strcat(cl -> info.str, xstr);
@@ -674,7 +674,7 @@ VAL idris_substr(VM* vm, VAL offset, VAL length, VAL str) {
674 char *start = idris_utf8_advance(GETSTR(str), GETINT(offset));
674 char *start = idris_utf8_advance(GETSTR(str), GETINT(offset));
675 char *end = idris_utf8_advance(start, GETINT(length));
675 char *end = idris_utf8_advance(start, GETINT(length));
676 Closure* newstr = allocate(sizeof(Closure) + (end - start) +1, 0);
676 Closure* newstr = allocate(sizeof(Closure) + (end - start) +1, 0);
677− SETTY(newstr, STRING);
677+ SETTY(newstr, CT_STRING);
678 newstr -> info.str = (char*)newstr + sizeof(Closure);
678 newstr -> info.str = (char*)newstr + sizeof(Closure);
679 memcpy(newstr -> info.str, start, end - start);
679 memcpy(newstr -> info.str, start, end - start);
680 *(newstr -> info.str + (end - start) + 1) = '\0';
680 *(newstr -> info.str + (end - start) + 1) = '\0';
@@ -685,7 +685,7 @@ VAL idris_strRev(VM* vm, VAL str) {
685 char *xstr = GETSTR(str);
685 char *xstr = GETSTR(str);
686 Closure* cl = allocate(sizeof(Closure) +
686 Closure* cl = allocate(sizeof(Closure) +
687 strlen(xstr) + 1, 0);
687 strlen(xstr) + 1, 0);
688− SETTY(cl, STRING);
688+ SETTY(cl, CT_STRING);
689 cl->info.str = (char*)cl + sizeof(Closure);
689 cl->info.str = (char*)cl + sizeof(Closure);
690 idris_utf8_rev(xstr, cl->info.str);
690 idris_utf8_rev(xstr, cl->info.str);
691 return cl;
691 return cl;
@@ -768,7 +768,7 @@ VAL doCopyTo(VM* vm, VAL x) {
768 return x;
768 return x;
769 }
769 }
770 switch(GETTY(x)) {
770 switch(GETTY(x)) {
771− case CON:
771+ case CT_CON:
772 ar = CARITY(x);
772 ar = CARITY(x);
773 if (ar == 0 && CTAG(x) < 256) { // globally allocated
773 if (ar == 0 && CTAG(x) < 256) { // globally allocated
774 cl = x;
774 cl = x;
@@ -782,34 +782,34 @@ VAL doCopyTo(VM* vm, VAL x) {
782 }
782 }
783 }
783 }
784 break;
784 break;
785− case FLOAT:
785+ case CT_FLOAT:
786 cl = MKFLOATc(vm, x->info.f);
786 cl = MKFLOATc(vm, x->info.f);
787 break;
787 break;
788− case STRING:
788+ case CT_STRING:
789 cl = MKSTRc(vm, x->info.str);
789 cl = MKSTRc(vm, x->info.str);
790 break;
790 break;
791− case BIGINT:
791+ case CT_BIGINT:
792 cl = MKBIGMc(vm, x->info.ptr);
792 cl = MKBIGMc(vm, x->info.ptr);
793 break;
793 break;
794− case PTR:
794+ case CT_PTR:
795 cl = MKPTRc(vm, x->info.ptr);
795 cl = MKPTRc(vm, x->info.ptr);
796 break;
796 break;
797− case MANAGEDPTR:
797+ case CT_MANAGEDPTR:
798 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
798 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
799 break;
799 break;
800− case BITS8:
800+ case CT_BITS8:
801 cl = idris_b8CopyForGC(vm, x);
801 cl = idris_b8CopyForGC(vm, x);
802 break;
802 break;
803− case BITS16:
803+ case CT_BITS16:
804 cl = idris_b16CopyForGC(vm, x);
804 cl = idris_b16CopyForGC(vm, x);
805 break;
805 break;
806− case BITS32:
806+ case CT_BITS32:
807 cl = idris_b32CopyForGC(vm, x);
807 cl = idris_b32CopyForGC(vm, x);
808 break;
808 break;
809− case BITS64:
809+ case CT_BITS64:
810 cl = idris_b64CopyForGC(vm, x);
810 cl = idris_b64CopyForGC(vm, x);
811 break;
811 break;
812− case RAWDATA:
812+ case CT_RAWDATA:
813 {
813 {
814 size_t size = x->info.size + sizeof(Closure);
814 size_t size = x->info.size + sizeof(Closure);
815 cl = allocate(size, 0);
815 cl = allocate(size, 0);
@@ -1019,7 +1019,7 @@ void init_nullaries() {
1019 nullary_cons = malloc(256 * sizeof(VAL));
1019 nullary_cons = malloc(256 * sizeof(VAL));
1020 for(i = 0; i < 256; ++i) {
1020 for(i = 0; i < 256; ++i) {
1021 cl = malloc(sizeof(Closure));
1021 cl = malloc(sizeof(Closure));
1022− SETTY(cl, CON);
1022+ SETTY(cl, CT_CON);
1023 cl->info.c.tag_arity = i << 8;
1023 cl->info.c.tag_arity = i << 8;
1024 nullary_cons[i] = cl;
1024 nullary_cons[i] = cl;
1025 }
1025 }
rts/idris_rts.h+9−9
@@ -25,9 +25,9 @@
25
25
26// Closures
26// Closures
27typedef enum {
27typedef enum {
28− CON, INT, BIGINT, FLOAT, STRING, STROFFSET,
28+ CT_CON, CT_INT, CT_BIGINT, CT_FLOAT, CT_STRING, CT_STROFFSET,
29− BITS8, BITS16, BITS32, BITS64, UNIT, PTR, FWD,
29+ CT_BITS8, CT_BITS16, CT_BITS32, CT_BITS64, CT_UNIT, CT_PTR, CT_FWD,
30− MANAGEDPTR, RAWDATA, CDATA
30+ CT_MANAGEDPTR, CT_RAWDATA, CT_CDATA
31} ClosureType;
31} ClosureType;
32
32
33typedef struct Closure *VAL;
33typedef struct Closure *VAL;
@@ -189,10 +189,10 @@ typedef void(*func)(VM*, VAL*);
189#define GETBITS32(x) (((VAL)(x))->info.bits32)
189#define GETBITS32(x) (((VAL)(x))->info.bits32)
190#define GETBITS64(x) (((VAL)(x))->info.bits64)
190#define GETBITS64(x) (((VAL)(x))->info.bits64)
191
191
192−#define TAG(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CON ? (x)->info.c.tag_arity >> 8 : (-1)) )
192+#define TAG(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CT_CON ? (x)->info.c.tag_arity >> 8 : (-1)) )
193−#define ARITY(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CON ? (x)->info.c.tag_arity & 0x000000ff : (-1)) )
193+#define ARITY(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CT_CON ? (x)->info.c.tag_arity & 0x000000ff : (-1)) )
194
194
195−// Already checked it's a CON
195+// Already checked it's a CT_CON
196#define CTAG(x) (((x)->info.c.tag_arity) >> 8)
196#define CTAG(x) (((x)->info.c.tag_arity) >> 8)
197#define CARITY(x) ((x)->info.c.tag_arity & 0x000000ff)
197#define CARITY(x) ((x)->info.c.tag_arity & 0x000000ff)
198
198
@@ -212,7 +212,7 @@ typedef intptr_t i_int;
212#define MKINT(x) ((void*)((x)<<1)+1)
212#define MKINT(x) ((void*)((x)<<1)+1)
213#define GETINT(x) ((i_int)(x)>>1)
213#define GETINT(x) ((i_int)(x)>>1)
214#define ISINT(x) ((((i_int)x)&1) == 1)
214#define ISINT(x) ((((i_int)x)&1) == 1)
215−#define ISSTR(x) (GETTY(x) == STRING)
215+#define ISSTR(x) (GETTY(x) == CT_STRING)
216
216
217#define INTOP(op,x,y) MKINT((i_int)((((i_int)x)>>1) op (((i_int)y)>>1)))
217#define INTOP(op,x,y) MKINT((i_int)((((i_int)x)>>1) op (((i_int)y)>>1)))
218#define UINTOP(op,x,y) MKINT((i_int)((((uintptr_t)x)>>1) op (((uintptr_t)y)>>1)))
218#define UINTOP(op,x,y) MKINT((i_int)((((uintptr_t)x)>>1) op (((uintptr_t)y)>>1)))
@@ -283,12 +283,12 @@ void idris_free(void* ptr, size_t size);
283
283
284#define allocCon(cl, vm, t, a, o) \
284#define allocCon(cl, vm, t, a, o) \
285 cl = allocate(sizeof(Closure) + sizeof(VAL)*a, o); \
285 cl = allocate(sizeof(Closure) + sizeof(VAL)*a, o); \
286− SETTY(cl, CON); \
286+ SETTY(cl, CT_CON); \
287 cl->info.c.tag_arity = ((t) << 8) | (a);
287 cl->info.c.tag_arity = ((t) << 8) | (a);
288
288
289#define updateCon(cl, old, t, a) \
289#define updateCon(cl, old, t, a) \
290 cl = old; \
290 cl = old; \
291− SETTY(cl, CON); \
291+ SETTY(cl, CT_CON); \
292 cl->info.c.tag_arity = ((t) << 8) | (a);
292 cl->info.c.tag_arity = ((t) << 8) | (a);
293
293
294#define NULL_CON(x) nullary_cons[x]
294#define NULL_CON(x) nullary_cons[x]