[cmucl-imp] Unboxed float arguments

Helmut Eller heller at common-lisp.net
Sun Jun 17 20:16:11 UTC 2012


* Helmut Eller [2012-06-09 07:46] writes:

> Attached is a prototype implementation to illustrate how this could be
> done.  See the comments in the file for the main points.  A more
> polished implementation would probably change more places then
> MAKE-XEP-LAMBDA.

I've done some more work on this and put it on github:
  https://github.com/ellerh/cmucl/tree/tcall-convention

The current version recognizes a new declaration calling-convention:

(defun f+ (x y)
  (declare (double-float x y)
	   (c::calling-convention :typed))
  (+ x y))

tells the compiler that f+ should have the special entry point for
unboxed floats.  The function will also have a regular XEP that will in
turn call the typed entry point (with a local call).  Calling f+ should
now transparently choose the appropriate entry point (i.e. named calls
use the typed entry point others the XEP).

Adapter functions are now created like so

  (lambda (x y)
    (declare (double-float x y)
	     (c::calling-convention :typed-no-xep))
    (the double-float (f+ x y)))

the :typed-no-xep version doesn't create regular XEPs as those would
never be used for adapters.

I could use a bit of feedback regarding the names.  Currently I use
"typed calling convention" resp. "typed entry point" and for the regular
entry point I use "external entry point" or XEP.  For the :typed-no-xep
case the naming is a bit misleading as the typed entry point is the only
entry point and in the IR has the lambda-kind set to :external, i.e. the
XEP is a typed entry.  Is there a better word for it?

Allegro CL seems to have a similar feature, which they call "immediate
arg call": ftp://ftp.franz.com/pub/duane/ilc07/immediate-args.html

Helmut



More information about the cmucl-imp mailing list