Okay, I have put a TGZ of my current folder up on Sourceforge.
It is from a fork of sbcl 1.0.40
The majority of the changes are in Codegen.lisp and assem.lisp in the compiler.
Currently it compiles with a really, really
dumb implementation of a single optimization.
There is also a file called 'peephole.lisp' which is intended to eventually be used as the compile-time pattern matcher.
It is also in the compiler folder, but is not loaded during the compile (mostly because of not-doneness).
Pretty much all we do is buffer assembly instruction structures, label structures, and alignments (as lambdas), into lists,
and then using a closure of the 'instruction (or label) emitter' which
is contained within the structure, we can emit them to a segment at any
The main thing that I am having difficulty understanding now is how
exactly TNs map onto machine registers, memory locations, etc.
I have a general idea, but it seems that in certain situations, my expectations are violated.
It is possible that using TNs as the basis for peephole optimization could
lead to a more powerful (different?) version of peephole optimization
than standard regex pattern matching (You may have information about
what registers are dead, and when, for example).
The other issue, is that this is my first foray into assembly language programming,
so I am not exactly full of insight as to what optimizations are actually optimizations...
I apologize for the primitive delivery of the code, I will see about setting up something with git or CVS later today,
and possibly merge it with a more recent version of SBCL.