Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also, SPARC has direct hardware support for this (for the cases that are relevant for JITed code, ie. arithmetics). But sadly, on current implementations it is often somehow emulated and thus slow.


It's because there isn't much point. Most Lisps use a tagging scheme like:

00 = Integer 01 = Pointer

With 00 as the integer tag, integer addition and subtraction can be done directly without masking off the tags. Multiplication and division need the tags masked, but are slow anyway. The tag can also be stripped off for free on any architecture that offers BASE + OFFSET addressing (just subtract 1 from the desired constant offset).


Apparently inspired by Lisp as well; this old '91 Usenet post by a Lucid employee claims that SPARC added the tagged-arithmetic support specifically for Lucid Common Lisp: http://compilers.iecc.com/comparch/article/91-04-082




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: