@@ -106,6 +106,10 @@ bcc i (ASSIGNCONST l c)
106 mkConst (Fl f) = "MKFLOAT(vm, " ++ show f ++ ")"
106 mkConst (Fl f) = "MKFLOAT(vm, " ++ show f ++ ")"
107 mkConst (Ch c) = "MKINT(" ++ show (fromEnum c) ++ ")"
107 mkConst (Ch c) = "MKINT(" ++ show (fromEnum c) ++ ")"
108 mkConst (Str s) = "MKSTR(vm, " ++ show s ++ ")"
108 mkConst (Str s) = "MKSTR(vm, " ++ show s ++ ")"
109+ mkConst (B8 x) = "idris_b8const(vm, " ++ show x ++ ")"
110+ mkConst (B16 x) = "idris_b16const(vm, " ++ show x ++ ")"
111+ mkConst (B32 x) = "idris_b32const(vm, " ++ show x ++ ")"
112+ mkConst (B64 x) = "idris_b64const(vm, " ++ show x ++ ")"
109 mkConst _ = "MKINT(42424242)"
113 mkConst _ = "MKINT(42424242)"
110bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"
114bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"
111bcc i (MKCON l tag args)
115bcc i (MKCON l tag args)
@@ -223,7 +227,10 @@ bcc i (NULL r) = indent i ++ creg r ++ " = NULL;\n" -- clear, so it'll be GCed
223bcc i (ERROR str) = indent i ++ "fprintf(stderr, " ++ show str ++ "); assert(0); exit(-1);"
227bcc i (ERROR str) = indent i ++ "fprintf(stderr, " ++ show str ++ "); assert(0); exit(-1);"
224-- bcc i _ = indent i ++ "// not done yet\n"
228-- bcc i _ = indent i ++ "// not done yet\n"
226−c_irts FInt l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
232+c_irts (FInt ITNative) l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
233+c_irts (FInt ty) l x = l ++ "idris_b" ++ show (intTyWidth ty) ++ "const(vm, " ++ x ++ ")"
227c_irts FChar l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
234c_irts FChar l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
228c_irts FString l x = l ++ "MKSTR(vm, " ++ x ++ ")"
235c_irts FString l x = l ++ "MKSTR(vm, " ++ x ++ ")"
229c_irts FUnit l x = x
236c_irts FUnit l x = x
@@ -231,7 +238,8 @@ c_irts FPtr l x = l ++ "MKPTR(vm, " ++ x ++ ")"
231c_irts FDouble l x = l ++ "MKFLOAT(vm, " ++ x ++ ")"
238c_irts FDouble l x = l ++ "MKFLOAT(vm, " ++ x ++ ")"
232c_irts FAny l x = l ++ x
239c_irts FAny l x = l ++ x
234−irts_c FInt x = "GETINT(" ++ x ++ ")"
241+irts_c (FInt ITNative) x = "GETINT(" ++ x ++ ")"
242+irts_c (FInt ty) x = "(" ++ x ++ "->info.bits" ++ show (intTyWidth ty) ++ ")"
235irts_c FChar x = "GETINT(" ++ x ++ ")"
243irts_c FChar x = "GETINT(" ++ x ++ ")"
236irts_c FString x = "GETSTR(" ++ x ++ ")"
244irts_c FString x = "GETSTR(" ++ x ++ ")"
237irts_c FUnit x = x
245irts_c FUnit x = x