@@ -0,0 +1,327 @@
3+VAL idris_b8CopyForGC(VM *vm, VAL a) {
4+ VAL cl = allocate(vm, sizeof(Closure), 1);
6+ cl->info.bits8 = a->info.bits8;
10+VAL idris_b16CopyForGC(VM *vm, VAL a) {
11+ VAL cl = allocate(vm, sizeof(Closure), 1);
13+ cl->info.bits16 = a->info.bits16;
17+VAL idris_b32CopyForGC(VM *vm, VAL a) {
18+ VAL cl = allocate(vm, sizeof(Closure), 1);
20+ cl->info.bits32 = a->info.bits32;
24+VAL idris_b64CopyForGC(VM *vm, VAL a) {
25+ VAL cl = allocate(vm, sizeof(Closure), 1);
27+ cl->info.bits64 = a->info.bits64;
31+VAL idris_b8(VM *vm, VAL a) {
32+ VAL cl = allocate(vm, sizeof(Closure), 0);
34+ cl->info.bits8 = (uint8_t) GETINT(a);
38+VAL idris_b16(VM *vm, VAL a) {
39+ VAL cl = allocate(vm, sizeof(Closure), 0);
41+ cl->info.bits16 = (uint16_t) GETINT(a);
45+VAL idris_b32(VM *vm, VAL a) {
46+ VAL cl = allocate(vm, sizeof(Closure), 0);
48+ cl->info.bits32 = (uint32_t) GETINT(a);
52+VAL idris_b64(VM *vm, VAL a) {
53+ VAL cl = allocate(vm, sizeof(Closure), 0);
55+ cl->info.bits64 = (uint64_t) GETINT(a);
59+VAL idris_b8Plus(VM *vm, VAL a, VAL b) {
60+ VAL cl = allocate(vm, sizeof(Closure), 0);
62+ cl->info.bits8 = a->info.bits8 + b->info.bits8;
66+VAL idris_b8Minus(VM *vm, VAL a, VAL b) {
67+ VAL cl = allocate(vm, sizeof(Closure), 0);
69+ cl->info.bits8 = a->info.bits8 - b->info.bits8;
73+VAL idris_b8Times(VM *vm, VAL a, VAL b) {
74+ VAL cl = allocate(vm, sizeof(Closure), 0);
76+ cl->info.bits8 = a->info.bits8 * b->info.bits8;
80+VAL idris_b8UDiv(VM *vm, VAL a, VAL b) {
81+ VAL cl = allocate(vm, sizeof(Closure), 0);
83+ cl->info.bits8 = a->info.bits8 / b->info.bits8;
87+VAL idris_b8SDiv(VM *vm, VAL a, VAL b) {
88+ VAL cl = allocate(vm, sizeof(Closure), 0);
90+ cl->info.bits8 = (uint8_t) (((int8_t) a->info.bits8) / ((int8_t) b->info.bits8));
94+VAL idris_b8Z16(VM *vm, VAL a) {
95+ VAL cl = allocate(vm, sizeof(Closure), 0);
97+ cl->info.bits16 = (uint16_t) a->info.bits8;
101+VAL idris_b8Z32(VM *vm, VAL a) {
102+ VAL cl = allocate(vm, sizeof(Closure), 0);
104+ cl->info.bits32 = (uint32_t) a->info.bits8;
108+VAL idris_b8Z64(VM *vm, VAL a) {
109+ VAL cl = allocate(vm, sizeof(Closure), 0);
111+ cl->info.bits64 = (uint64_t) a->info.bits8;
115+VAL idris_b8S16(VM *vm, VAL a) {
116+ VAL cl = allocate(vm, sizeof(Closure), 0);
118+ cl->info.bits16 = (uint16_t) (int16_t) (int8_t) a->info.bits8;
122+VAL idris_b8S32(VM *vm, VAL a) {
123+ VAL cl = allocate(vm, sizeof(Closure), 0);
125+ cl->info.bits32 = (uint32_t) (int32_t) (int8_t) a->info.bits8;
129+VAL idris_b8S64(VM *vm, VAL a) {
130+ VAL cl = allocate(vm, sizeof(Closure), 0);
132+ cl->info.bits64 = (uint64_t) (int64_t) (int8_t) a->info.bits8;
136+VAL idris_b16Plus(VM *vm, VAL a, VAL b) {
137+ VAL cl = allocate(vm, sizeof(Closure), 0);
139+ cl->info.bits16 = a->info.bits16 + b->info.bits16;
143+VAL idris_b16Minus(VM *vm, VAL a, VAL b) {
144+ VAL cl = allocate(vm, sizeof(Closure), 0);
146+ cl->info.bits16 = a->info.bits16 - b->info.bits16;
150+VAL idris_b16Times(VM *vm, VAL a, VAL b) {
151+ VAL cl = allocate(vm, sizeof(Closure), 0);
153+ cl->info.bits16 = a->info.bits16 * b->info.bits16;
157+VAL idris_b16UDiv(VM *vm, VAL a, VAL b) {
158+ VAL cl = allocate(vm, sizeof(Closure), 0);
160+ cl->info.bits16 = a->info.bits16 / b->info.bits16;
164+VAL idris_b16SDiv(VM *vm, VAL a, VAL b) {
165+ VAL cl = allocate(vm, sizeof(Closure), 0);
168+ (uint16_t) (((int16_t) a->info.bits16) / ((int16_t) b->info.bits16));
172+VAL idris_b16Z32(VM *vm, VAL a) {
173+ VAL cl = allocate(vm, sizeof(Closure), 0);
175+ cl->info.bits32 = (uint32_t) a->info.bits16;
179+VAL idris_b16Z64(VM *vm, VAL a) {
180+ VAL cl = allocate(vm, sizeof(Closure), 0);
182+ cl->info.bits64 = (uint64_t) a->info.bits16;
186+VAL idris_b16S32(VM *vm, VAL a) {
187+ VAL cl = allocate(vm, sizeof(Closure), 0);
189+ cl->info.bits32 = (uint32_t) (int32_t) (int16_t) a->info.bits16;
193+VAL idris_b16S64(VM *vm, VAL a) {
194+ VAL cl = allocate(vm, sizeof(Closure), 0);
196+ cl->info.bits64 = (uint64_t) (int64_t) (int16_t) a->info.bits16;
200+VAL idris_b16T8(VM *vm, VAL a) {
201+ VAL cl = allocate(vm, sizeof(Closure), 0);
203+ cl->info.bits8 = (uint8_t) a->info.bits16;
207+VAL idris_b32Plus(VM *vm, VAL a, VAL b) {
208+ VAL cl = allocate(vm, sizeof(Closure), 0);
210+ cl->info.bits32 = a->info.bits32 + b->info.bits32;
214+VAL idris_b32Minus(VM *vm, VAL a, VAL b) {
215+ VAL cl = allocate(vm, sizeof(Closure), 0);
217+ cl->info.bits32 = a->info.bits32 - b->info.bits32;
221+VAL idris_b32Times(VM *vm, VAL a, VAL b) {
222+ VAL cl = allocate(vm, sizeof(Closure), 0);
224+ cl->info.bits32 = a->info.bits32 * b->info.bits32;
228+VAL idris_b32UDiv(VM *vm, VAL a, VAL b) {
229+ VAL cl = allocate(vm, sizeof(Closure), 0);
231+ cl->info.bits32 = a->info.bits32 / b->info.bits32;
235+VAL idris_b32SDiv(VM *vm, VAL a, VAL b) {
236+ VAL cl = allocate(vm, sizeof(Closure), 0);
239+ (uint32_t) (((int32_t) a->info.bits32) / ((int32_t) b->info.bits32));
243+VAL idris_b32Z64(VM *vm, VAL a) {
244+ VAL cl = allocate(vm, sizeof(Closure), 0);
246+ cl->info.bits64 = (uint64_t) a->info.bits32;
250+VAL idris_b32S64(VM *vm, VAL a) {
251+ VAL cl = allocate(vm, sizeof(Closure), 0);
253+ cl->info.bits64 = (uint64_t) (int64_t) (int32_t) a->info.bits32;
257+VAL idris_b32T8(VM *vm, VAL a) {
258+ VAL cl = allocate(vm, sizeof(Closure), 0);
260+ cl->info.bits8 = (uint8_t) a->info.bits32;
264+VAL idris_b32T16(VM *vm, VAL a) {
265+ VAL cl = allocate(vm, sizeof(Closure), 0);
267+ cl->info.bits16 = (uint16_t) a->info.bits32;
271+VAL idris_b64Plus(VM *vm, VAL a, VAL b) {
272+ VAL cl = allocate(vm, sizeof(Closure), 0);
274+ cl->info.bits64 = a->info.bits64 + b->info.bits64;
278+VAL idris_b64Minus(VM *vm, VAL a, VAL b) {
279+ VAL cl = allocate(vm, sizeof(Closure), 0);
281+ cl->info.bits64 = a->info.bits64 - b->info.bits64;
285+VAL idris_b64Times(VM *vm, VAL a, VAL b) {
286+ VAL cl = allocate(vm, sizeof(Closure), 0);
288+ cl->info.bits64 = a->info.bits64 * b->info.bits64;
292+VAL idris_b64UDiv(VM *vm, VAL a, VAL b) {
293+ VAL cl = allocate(vm, sizeof(Closure), 0);
295+ cl->info.bits64 = a->info.bits64 / b->info.bits64;
299+VAL idris_b64SDiv(VM *vm, VAL a, VAL b) {
300+ VAL cl = allocate(vm, sizeof(Closure), 0);
303+ (uint64_t) (((int64_t) a->info.bits64) / ((int64_t) b->info.bits64));
307+VAL idris_b64T8(VM *vm, VAL a) {
308+ VAL cl = allocate(vm, sizeof(Closure), 0);
310+ cl->info.bits8 = (uint8_t) a->info.bits64;
314+VAL idris_b64T16(VM *vm, VAL a) {
315+ VAL cl = allocate(vm, sizeof(Closure), 0);
317+ cl->info.bits16 = (uint16_t) a->info.bits64;
321+VAL idris_b64T32(VM *vm, VAL a) {
322+ VAL cl = allocate(vm, sizeof(Closure), 0);
324+ cl->info.bits32 = (uint32_t) a->info.bits64;