[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

flonum consing

So to avoid float (and other immediate) consing on function args/return vals,
couldn't you have the compiler automatically produce two entry points for
functions, one for general lisp vals, and one that expected float args in
certain regs, and returned float results in certain other regs?  [You could
also have flag somewhere instead of multiple entry points]

Since you probably still want type checking, the float-reg version could have
magic cookies in the corresponding lisp arg slots (and return slot(s)),
something like #<Float register ref %f5>, which you could type check.  Since
you only need a constant set of these, you never need to cons them, and you
can store them off of NIL so you can load/compare quickly.  If you set
safety=0, it wouldn't even look at these (although you still need to stuff
them in the arg-slots for calling other funcs-- not a big deal, since it
should only be a single instruction), and it would be just as efficient as C...


Miles Bader  --  HCRC, University of Edinburgh  --  Miles.Bader@ed.ac.uk
99% of everything is grunge