Use immediates

This commit is contained in:
Justin Ethier 2016-03-19 22:38:23 -04:00
parent 580a674525
commit 05d39afd3f
2 changed files with 12 additions and 12 deletions

View file

@ -1533,10 +1533,10 @@ object Cyc_num_op_va_list(void *data, int argc, object (fn_op(void *, common_typ
fn_op(data, buf, va_arg(ns, object));
}
// // TODO: if result is integer, could convert to an immediate here
// if (type_of(buf) == integer_tag) {
// return obj_int2obj(buf->integer_t.value);
// }
// TODO: if result is integer, could convert to an immediate here
if (type_of(buf) == integer_tag) {
return obj_int2obj(buf->integer_t.value);
}
return buf;
}

View file

@ -405,14 +405,14 @@
((vector? exp)
(c-compile-vector exp))
((integer? exp)
(let ((cvar-name (mangle (gensym 'c))))
(c-code/vars
(string-append "&" cvar-name) ; Code is just the variable name
(list ; Allocate integer on the C stack
(string-append
"make_int(" cvar-name ", " (number->string exp) ");")))))
; (c-code (string-append "obj_int2obj("
; (number->string exp) ")")))
; (let ((cvar-name (mangle (gensym 'c))))
; (c-code/vars
; (string-append "&" cvar-name) ; Code is just the variable name
; (list ; Allocate integer on the C stack
; (string-append
; "make_int(" cvar-name ", " (number->string exp) ");")))))
(c-code (string-append "obj_int2obj("
(number->string exp) ")")))
((real? exp)
(let ((cvar-name (mangle (gensym 'c))))
(c-code/vars