X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/1144856ba9d6018d9922c6ede7e97779a0fe6373..075222c771a121b12d6f07f39af868ae14cd06a1:/README?ds=sidebyside diff --git a/README b/README index ccc7581..3c068e3 100644 --- a/README +++ b/README @@ -1,64 +1,69 @@ README ------ -This compiler is a big long chain of modules that transform l4 code into +This compiler is a big long chain of modules that transform L5 code into x86_64 assembly. -Here is a breakdown of the modules and changes from l3: +Here is a breakdown of the modules and changes from L5: - * The parser. The parser was mainly brought in from lab 3, and mainly - just a straight-forward extension of the l3 parser. We changed asops, - since they now side-effect and need special properties. We also added - dereferences, arrays, other nice things. + * The parser. The parser was mainly brought in from lab 4, and mainly + just a straight-forward extension of the L4 parser to have increments, + decrements, conditionals, and hex constants. - * AST utilities. Some of those now exist to make common operations on raw - AST structures less painful. - - * The typechecker. The typechecker was significantly revamped. A - 'typeof' function was added that did most of the typechecking work; - the rest was relatively trivial compared to typeof. There were many - annoying things other than typeof, but typeof was the most interesting - to comment on. - - * The translator was extended with support for sizing up structs. It now - is smarter about translating asops. A MEMORY thingo was added to the - Tree, as was ALLOC. - - * The x86/munch modules were extended with support for multiple operand - sizes. This was done in a fashion of extreme type A, and needs to be - blasted before the next lab, for it is worthless, terrible, awful, ... A - major falling-down of this compiler is that it passes size information - around in no less than 235784 different fashions, and the translation - between each has caused us no end of grief. If we had time to rewrite - it instead of firefighting broken tests, uh... we would. Many of our - optimizations from last lab needed to be commented out because of this - temporary sizing sadness. - - * The liveness analyzer was mainly unchanged, but for a few rules. + * AST utilities were updated to use the new temp typing system. + + * Temporaries now are the only source of sizing information until we hit + the stage at which point instructions are generated. At that point, + instructions get sizing info, too, but really, that's about it. + + * The typechecker was mostly unchanged. + + * The translator was changed to use the new sizing system. Of interest, + the 'safe' alloc routine and the 'safe' dereference routines have been + moved into the IR stage, as opposed to having custom instructions + generated for them at the munch stage. This was done with the addition + of the 'stmvar' IR function, which is equivalent to the GCC C extension: + ({ stm; stm; ... expr }) + in that it evaluates the statements first, then returns the evaluation + of the expression. + + * The munch modules were updated to remove a lot of their suck and make + them correct again. Specifically, they were updated to use the new + typing system and perform type inference of sorts (i.e. adding a + quadword base pointer and a long offset yields a quad, etc.). This is + far superior to the previous sizing method, in which we gave some loose + (and disgusting) annotations of size and left the final sizing decisions + to the stringifier (O.o). + + * The liveness analyzer was mainly unchanged. * The grapher was fully unchanged. Nice. - * The color orderer was fully unchanged. Nice. + * The color orderer was optimized a bit. * The coloring module was fully unchanged. Nice. - * The solidifier was modified to deal with the fact that certain things - could not be accessed directly. It, too, has become an unmitigated - disaster. It must deal with all 875847384 of the sizes, and I am sad - about this. + * The solidifier was similarly ripped out and hit by the diqing beam, sent + on a flight to Diqing airport, which is in Diqing which is in + the Diqing province in China, and subsequently it was diqed. It is now + much happier. + + * The peepholer has been moved into the optimization framework. - * The peepholer lost one form of fail and loss sizing. + * An optimization framework was added, allowing optimizers to be + individually turned off from the command line with approximately no work + on our part. I'm particularly proud of the simplicity with which it + allows one to write optimizations; see optimize/feckful.sml. They need + only be hooked in one place (in particular, in a list at the top of + top.sml). Individual optimizations will be discussed in the paper to be + handed in tomorrow. * The stringifier is of no interest to you, for it does real things that interact with the real world, and that is not of interest to people who write in ML. - * Our internal representation of x86 assembly was changed. In particular, - conditional sets and jumps are now SETcc of cc * oper and Jcc of cc * - oper, instead of a separate SET or J for each condition code. This - simplifies other parts of the code as well. - We believe that it is fully functional. We generate correct code whenever we are supposed to, and we pass every test that we can lay our hands on -(including all of l2, and one of ours that killed the reference compiler). -Of course, our last bug was caught by only one failing test, so... \ No newline at end of file +(including all of the regression suite). There are a number of optimizations +that we wish to do, especially various interprocedural ones, but we ran out +of time.