Horray! All optimizations have been implemented and tested. I've also added the quicker comparisons for -2,-1,1,2.
So the objective now is to test this with a larger program, and make sure the generated code runs properly. Should be fine, though. Once that's complete, I need to make patches and a new build procedure.
By the way, use -Os to optimize for size. Handy for the TI.