]> Joshua Wise's Git repositories - snipe.git/blobdiff - README
Initial import of l4c
[snipe.git] / README
diff --git a/README b/README
index 66a2e239e1769abfc350a7c1424d9808f9015427..ccc758154db0789c17f38c99c62f86cafa06ca7b 100644 (file)
--- a/README
+++ b/README
@@ -1,69 +1,64 @@
 README
 ------
 
-This compiler is a big long chain of modules that transform l2 code into
+This compiler is a big long chain of modules that transform l4 code into
 x86_64 assembly.
 
-These modules include:
+Here is a breakdown of the modules and changes from l3:
 
-  * The parser.  The parser was mainly brought in from lab 1, and mainly
-    just a straight-forward extension of the l1 parser.  We continued to
-    mark expressions, and pass marking through as needed so that we could
-    produce reasonable error messages up through translation stage.  We
-    introduced all needed grammar with no shift/reduce conflicts, but for
-    one in the IF/ELSE stage, with a construct such as:
-      if (x)
-      if (z)
-      a
-      else
-      b
-    (indentation intentionally omitted; there are at least two legitimate
-    ways to parse that!)
-  * The typechecker.  This module was completely rewritten since lab1.  Three
-    checks are instituted: a check to see if the program has misplaced break
-    or continue statements, a check to see that the program returns in all
-    control paths, and a check that all variables are initialized in all
-    control paths before usage.
+  * 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 return and break check is essentially implemented per the rules; the
-    only thing of interest for the variable initialization routine is that
-    there is a helper that computes all assigns to extend contexts from
-    block contents.  It was determined that returning 2 accumulators from
-    varcheck would lead to returning 17 accumulators, which would lead to
-    1984193248148132 accumulators; and 238547854478 accumulators leads to
-    the foldl, and foldl leads to anger, anger leads to hate, and hate leads
-    to the Dark Side.
-  * The translator is mainly intact; it was determined that the IR will have
-    basic control flow instructions of labels, jumps, and jump if not
-    conditional, which we deemed sufficient to implement all forms of l2
-    control.
-  * The munch module was fully rewritten; we now munch directly to
-    pseudo-x86_64, in that it has temporaries allowed in it as well.  We
-    believe that this allows us to generate much more optimal code than
-    munching into three op, converting from three to two, then converting
-    two to x86_64; in particular, we can run liveness on the x86_64
-    directions directly, which makes translation significantly easier (we do
-    not have to worry about mashing necessary registers).
-  * The liveness analyzer was also fully rewritten; it is now fully
-    def-use-succ, giving us very pretty rules, and a lot of very ugly code
-    to mash them together.  Luckily, the ugly code need not be touched ever
-    again.
-  * The grapher had about 4 characters of inconsequential change that had
-    the useful property of speeding it up by two orders of magnitude.  You
-    need not worry about it.
-  * The orderer and colorer had no changes.
-  * A new module was introduced -- in particular, the solidifier.  The
-    solidifier takes pseudo-x86_64 that is annotated with register locations
-    and emits needed spill and unspill operations to get everything into
-    real registers that the x86_64 chips can access.
-  * The peepholer remains pretty simple; redundant moves are optimized out,
-    and hence the code size drops by a factor of 1.5 or so.
+  * 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.
+
+  * The grapher was fully unchanged.  Nice.
+
+  * The color orderer was fully unchanged.  Nice.
+
+  * 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 peepholer lost one form of fail and loss sizing.
+
   * 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.
 
-We believe that it's fully functional; we have not had a case in quite some
-time that caused us to generate incorrect code (at least, when we should
-generate code).  The internal debug mechanisms are very useful; often a
-line-by-line examination of dumps after each translation phase can narrow
-bugs down into single lines of ML code.
+  * 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
This page took 0.02516 seconds and 4 git commands to generate.