From a35078a6d30c1eb5dabcf6d9c001cdd41e2b7c89 Mon Sep 17 00:00:00 2001 From: dibyendumajumdar Date: Tue, 6 Aug 2024 00:38:18 +0100 Subject: #92 Update readmes --- README.md | 14 +++++++------- chapter12/README.md | 4 +--- chapter13/README.md | 47 +---------------------------------------------- 3 files changed, 9 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index a664dfca..1cdd4937 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ The simple language will be a small subset of C. * [Chapter 9](chapter09/README.md): Global Value Numbering. Iterative peepholes to fixpoint. Worklists. * [Chapter 10](chapter10/README.md): User defined Struct types. Memory effects: general memory edges in SSA. Equivalence class aliasing. Null pointer analysis. Peephole optimization around load-after-store/store-after-store. * [Chapter 11](chapter11/README.md): Global Code Motion - Scheduling. -* Chapter 12: Nested references in Structs. Float type. One dimensional static length array type. Array load/store. -* Chapter 13: Functions and calls. -* Chapter 14: Boolean operators `&&` and `||` including short circuit. -* Chapter 16: Code generation: perhaps to Java bytecodes. -* Chapter 17: Code generation: to native X86 or ARM. Instruction selection, BURS. Register allocation. -* Chapter 18: Exceptions -* Chapter 19: Garbage Collection. +* [Chapter 12](chapter12/README.md): Float type. +* [Chapter 13](chapter13/README.md): Nested references in Structs. +* Chapter 14: One dimensional static length array type. Array load/store. +* Chapter 15: Functions and calls. +* Chapter 16: Exception control flow. +* Chapter 17: Garbage Collection. +* Chapter 18: Code gen to X86-64. diff --git a/chapter12/README.md b/chapter12/README.md index e381f1dc..4fb18df6 100644 --- a/chapter12/README.md +++ b/chapter12/README.md @@ -1,9 +1,7 @@ -# Chapter 12: Floats, Arrays, Refs +# Chapter 12: Floats ## Floats -In this chapter we add a series of new types and some modest syntax. - Floating point values start with the `flt` type and compute IEEE754 64-bit arithmetic. Integer expressions auto-widen to floats when involved in a float expression. diff --git a/chapter13/README.md b/chapter13/README.md index 892f7170..1fe2097a 100644 --- a/chapter13/README.md +++ b/chapter13/README.md @@ -1,49 +1,4 @@ -# Chapter 12: Floats, References and Arrays - -In this chapter we add a series of new types and some modest syntax. - -## Floats - -Floating point values start with the `flt` type and compute IEEE754 64-bit arithmetic. -Integer expressions auto-widen to floats when involved in a float expression. - -```java -flt f = 0.5; -int x = 2; -f = f+x; // Auto-widen x to 2.0, result is 2.5 -f = f+true; // Since bools are just synonyms for integers 0,1 they auto-widen also -``` - - -Here is Newton's method to a square root: -```java -flt guess = arg; // Initial guess is just argument -while( true ) { - // Next guess from Newton's method - flt next = (arg/guess + guess)/2; - // Break if hit fixed point - if( next == guess ) break; - guess = next; -} -return guess; -``` -When run with argument 2.0, produces 1.414213562373095. - -Floating point operations have their own Nodes: - -| Node | Op | -|------------------------|----------------------| -| AddF, SubF, MulF, DivF | Basic binary FP ops | -| MinusF | Unary negate | -| EQF, LTF, LEF | FP compare operators | - -And their own section in the Type lattice: - -Within the Type Lattice, we now add the following domain: - -* Float type - Float values. The same shape as the Integer values, but floats - with a TOP, BOT and constants - +# Chapter 13: References ## References -- cgit v1.2.3