mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
Use immediates
This commit is contained in:
parent
580a674525
commit
05d39afd3f
2 changed files with 12 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue