Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!news.alpha.net!mvb.saic.com!eskimo!miles
From: miles@eskimo.com (Miles Bader)
Subject: Re: Stopping fp functions consing in CMUCL
Message-ID: <Cvv8Eo.L0n@eskimo.com>
Organization: Eskimo North (206) For-Ever
References: <TFB.94Sep7120427@burns.cogsci.ed.ac.uk> <34nirm$pl6@cantaloupe.srv.cs.cmu.edu>
Date: Fri, 9 Sep 1994 14:03:55 GMT
Lines: 29

How about each function having two (standard) entry points, a normal one, and
an "unboxed one."  Functions calling the "unboxed" entry point would be able
to both pass unboxed args & would expect to have to deal with unboxed return
values.

When calling this second entry point, args & return values could optionally
be some sort of magic cookie (a valid lisp object, but not useful in any
wider context) that either said where the actual value was, or just implied
it (i.e., [return]argN is in float-regN).  You would have different magic
cookies for the various types that could profitably be unboxed (floats,
(unsigned-byte 32), etc.).

There could be a standard shared unboxed entry point that simply boxed any
unboxed arguments and called the normal entry point, for any functions that
weren't compiled to take advantage of this feature...

This might be a great big hairy mess, and probably would require additional
(object) code all over the place, but it seems like it would work, and it
_would_ avoid consing...  (presumably you would still return boxed values
when you had them handy, to avoid boxing previously boxed values returned
unboxed...)

Comments?

-Miles
-- 
-- 
Miles Bader / miles@eskimo.com / (206) 842-7219
`Life is a boundless sea of bitterness'
