Attached is a patch that I intend to commit (unless advised otherwise
:-) assuming that it builds itself on Sparc Linux for me... so not for
another 24 hours at the earliest. :-/
What does it do? Firstly, it allows the user to compile a core for
V8 or V9 sparcs (the :sparc-v8 and :sparc-v9 backend subfeatures
actually mean v8-or-higher and v9-or-higher with the caveat that at some
point deprecated instructions might disappear), such that the lisp
runtime library uses some of the advanced features of these chips (sane
integer multiplication, branch with prediction, and so on). The
:sparc-64 feature is not supported -- it represents work in progress by
Raymond Toy for a 64-bit lisp.
Secondly, it allows the emission of code to be dynamically targeted, by
changing the value of the sb-c:*backend-subfeatures* variable, by
checking it at VOP emission time (via the :guard functionality in VOPs,
and once or twice in the body of the emitters).
This, because of a slight quirk in sparc backward compatibility, has
caused the disassembler to be not quite as smart as it could be; it
can't tell the difference between a v8 T [trap] instruction and a v9 TCC
[trap with condition code] instruction. This only affects the
disassembly of these particular instructions, though, and it was wrong
before when a vanilla core was run on a sparc v9 in any case...
There is one other problem (marked with "KLUDGE FIXME YAARGH"): floating
point compares require a delay on v8s or earlier and not on v9s -- I
couldn't work out a way of expressing this in the new scheme, though
again the problem now is no worse than before.
Finally, it does s/fixnum-tag-bits/n-fixnum-tag-bits/ and the like, for
consistency with the rest of the sbcl codebase.
Jesus College, Cambridge, CB5 8BL +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)