[cmucl-imp] Unboxed float arguments
Helmut Eller
heller at common-lisp.net
Sat Jun 9 07:46:17 UTC 2012
Here is an idea for a calling convention that supports unboxed floats:
1. When DEFUN compiles a function that has a ftype declaration involving
floats, it creates a special entry-point that accepts unboxed arguments.
2. Named calls to such functions are compiled so that the arguments are
represented as indicated by the ftype declaration.
3. We also keep a linker table to connect those special entry-points to
call-sites. When the function gets redefined, we go through the
existing call-sites and patch them so that the new definition is called.
If the type of the new definition is different than the one expected by
the call-site, we create an "adapter function" that converts the
representation to the new type or if the conversion is not possible
signals an error.
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.
What do you think: is such a calling convention worth having?
Helmut
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: typed-call.lisp
URL: <http://lists.zs64.net/mailman-archive/cmucl-imp/attachments/20120609/cea0fa74/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tests.lisp
URL: <http://lists.zs64.net/mailman-archive/cmucl-imp/attachments/20120609/cea0fa74/attachment-0003.ksh>
More information about the cmucl-imp
mailing list