summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-09 17:01:02 -0700
committerCliff Click <cliffc@acm.org>2026-09-09 17:01:02 -0700
commit1f4006e88df54e2b7086bc49e05ffc6d2068e8fd (patch)
tree92e8204618117676e962679fa0b385b2db047674
parent91c6ed0f6978215a0448f5bf91600e5fdb2a77d8 (diff)
parent6b4ed4d07831f738755cb8162eff24d6d9a695fc (diff)
downloadSimple-1f4006e88df54e2b7086bc49e05ffc6d2068e8fd.tar.gz
Simple-1f4006e88df54e2b7086bc49e05ffc6d2068e8fd.zip
Merge branch 'main' of https://github.com/SeaOfNodes/Simple
-rw-r--r--chapter04/README.md5
-rw-r--r--chapter04/src/main/java/com/seaofnodes/simple/node/AddNode.java10
-rw-r--r--chapter05/README.md6
-rw-r--r--chapter05/src/main/java/com/seaofnodes/simple/node/AddNode.java10
-rw-r--r--chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java10
-rw-r--r--chapter06/src/main/java/com/seaofnodes/simple/node/BoolNode.java7
-rw-r--r--chapter07/src/main/java/com/seaofnodes/simple/node/AddNode.java10
-rw-r--r--chapter07/src/main/java/com/seaofnodes/simple/node/BoolNode.java7
-rw-r--r--chapter08/src/main/java/com/seaofnodes/simple/node/AddNode.java10
-rw-r--r--chapter08/src/main/java/com/seaofnodes/simple/node/BoolNode.java7
-rw-r--r--chapter09/src/main/java/com/seaofnodes/simple/node/BoolNode.java7
-rw-r--r--chapter10/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter11/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter12/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter13/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter15/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter16/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter17/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter18/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter19/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter20/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter21/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter22/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter23/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter24/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
-rw-r--r--chapter25/src/main/java/com/seaofnodes/simple/node/BoolNode.java6
26 files changed, 95 insertions, 84 deletions
diff --git a/chapter04/README.md b/chapter04/README.md
index a7b223b4..272d0b8d 100644
--- a/chapter04/README.md
+++ b/chapter04/README.md
@@ -39,10 +39,13 @@ Following are revised or new nodes
|-----------|----------------|------------------------------------------------|-----------------------|----------------------------------------------------------------------------|
| MultiNode | Abstract class | A node that has a tuple result | | A tuple |
| Start | Control | Start of function, now a MultiNode | | A tuple with a ctrl token and an `arg` data node |
-| Proj | Data | Projection nodes extract values from MultiNode | A MultiNode and index | Result is the extracted value from the input MultiNode at offset index |
+| Proj | Data / Control | Projection nodes extract values from MultiNode | A MultiNode and index | Result is the extracted value from the input MultiNode at offset index |
| Bool | Data | Represents results of a comparison operator | Two data nodes | Result is a comparison, represented as integer value where 1=true, 0=false |
| Not | Data | Logical not | One data node | Result converts 0 to 1 and vice versa |
+> A `Proj` is a control node when it projects the control slot: `Proj#0` off `Start`.
+> Every other projection is a data node. See `ProjNode.isCFG()`.
+
Below is our list of Nodes from [Chapter 3](../chapter03/README.md):
| Node Name | Type | Description | Inputs | Value |
diff --git a/chapter04/src/main/java/com/seaofnodes/simple/node/AddNode.java b/chapter04/src/main/java/com/seaofnodes/simple/node/AddNode.java
index 5720aca4..7e08a207 100644
--- a/chapter04/src/main/java/com/seaofnodes/simple/node/AddNode.java
+++ b/chapter04/src/main/java/com/seaofnodes/simple/node/AddNode.java
@@ -63,7 +63,7 @@ public class AddNode extends Node {
// Now we might see (add add non) or (add non non) but never (add non add) nor (add add add)
if( !(lhs instanceof AddNode) )
- return spline_cmp(lhs,rhs) ? swap12() : null;
+ return spine_cmp(lhs,rhs) ? swap12() : null;
// Now we only see (add add non)
@@ -72,22 +72,22 @@ public class AddNode extends Node {
if( lhs.in(2)._type.isConstant() && t2.isConstant() )
return new AddNode(lhs.in(1),new AddNode(lhs.in(2),rhs).peephole());
- // Now we sort along the spline via rotates, to gather similar things together.
+ // Now we sort along the spine via rotates, to gather similar things together.
// Do we rotate (x + y) + z
// into (x + z) + y ?
- if( spline_cmp(lhs.in(2),rhs) )
+ if( spine_cmp(lhs.in(2),rhs) )
return new AddNode(new AddNode(lhs.in(1),rhs).peephole(),lhs.in(2));
return null;
}
- // Compare two off-spline nodes and decide what order they should be in.
+ // Compare two off-spine nodes and decide what order they should be in.
// Do we rotate ((x + hi) + lo) into ((x + lo) + hi) ?
// Generally constants always go right, then others.
// Ties with in a category sort by node ID.
// TRUE if swapping hi and lo.
- static boolean spline_cmp( Node hi, Node lo ) {
+ static boolean spine_cmp( Node hi, Node lo ) {
if( lo._type.isConstant() ) return false;
if( hi._type.isConstant() ) return true ;
diff --git a/chapter05/README.md b/chapter05/README.md
index 88bacbfc..7337da33 100644
--- a/chapter05/README.md
+++ b/chapter05/README.md
@@ -41,7 +41,7 @@ Here is a recap of the nodes introduced in previous chapters:
|-----------|----------------|---------|------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| Multi | Abstract class | 4 | A node that has a tuple result | | A tuple |
| Start | Control | 1 | Start of function, now a MultiNode | | A tuple with a ctrl token and an `arg` data node |
-| Proj | Data | 4 | Projection nodes extract values from MultiNode | A MultiNode and index | Result is the extracted value from the input MultiNode at offset index |
+| Proj | Data / Control | 4 | Projection nodes extract values from MultiNode | A MultiNode and index | Result is the extracted value from the input MultiNode at offset index |
| Bool | Data | 4 | Represents results of a comparison operator | Two data nodes | Result is a comparison, represented as integer value where 1=true, 0=false |
| Not | Data | 4 | Logical not | One data node | Result converts 0 to 1 and vice versa |
| Return | Control | 1 | End of function | Predecessor control node and a data node for the return value of the function | Return value of the function |
@@ -53,6 +53,10 @@ Here is a recap of the nodes introduced in previous chapters:
| Minus | Data | 2 | Negate a value | One data node which value is negated | Result of the negation |
| Scope | Symbol Table | 3 | Represents scopes in the graph | Nodes that represent the current value of variables | None |
+> A `Proj` is a control node when it projects a control slot: `Proj#0` off `Start`,
+> and both projections off an `If`. Every other projection is a data node.
+> See `ProjNode.isCFG()`.
+
## New Nodes
The following new nodes are introduced in this chapter:
diff --git a/chapter05/src/main/java/com/seaofnodes/simple/node/AddNode.java b/chapter05/src/main/java/com/seaofnodes/simple/node/AddNode.java
index 081c9276..62d1e249 100644
--- a/chapter05/src/main/java/com/seaofnodes/simple/node/AddNode.java
+++ b/chapter05/src/main/java/com/seaofnodes/simple/node/AddNode.java
@@ -63,7 +63,7 @@ public class AddNode extends Node {
// Now we might see (add add non) or (add non non) but never (add non add) nor (add add add)
if( !(lhs instanceof AddNode) )
- return spline_cmp(lhs,rhs) ? swap12() : null;
+ return spine_cmp(lhs,rhs) ? swap12() : null;
// Now we only see (add add non)
@@ -90,22 +90,22 @@ public class AddNode extends Node {
return new AddNode(lhs.in(1),new PhiNode(label,ns).peephole());
}
- // Now we sort along the spline via rotates, to gather similar things together.
+ // Now we sort along the spine via rotates, to gather similar things together.
// Do we rotate (x + y) + z
// into (x + z) + y ?
- if( spline_cmp(lhs.in(2),rhs) )
+ if( spine_cmp(lhs.in(2),rhs) )
return new AddNode(new AddNode(lhs.in(1),rhs).peephole(),lhs.in(2));
return null;
}
- // Compare two off-spline nodes and decide what order they should be in.
+ // Compare two off-spine nodes and decide what order they should be in.
// Do we rotate ((x + hi) + lo) into ((x + lo) + hi) ?
// Generally constants always go right, then Phi-of-constants, then muls, then others.
// Ties with in a category sort by node ID.
// TRUE if swapping hi and lo.
- static boolean spline_cmp( Node hi, Node lo ) {
+ static boolean spine_cmp( Node hi, Node lo ) {
if( lo._type.isConstant() ) return false;
if( hi._type.isConstant() ) return true ;
diff --git a/chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java b/chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java
index b37785f6..af2a41b3 100644
--- a/chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java
+++ b/chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java
@@ -64,7 +64,7 @@ public class AddNode extends Node {
// Now we might see (add add non) or (add non non) but never (add non add) nor (add add add)
if( !(lhs instanceof AddNode) )
// Rotate; look for (add (phi cons) con/(phi cons))
- return spline_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
+ return spine_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
// Now we only see (add add non)
@@ -80,11 +80,11 @@ public class AddNode extends Node {
Node phicon = phiCon(this,true);
if( phicon!=null ) return phicon;
- // Now we sort along the spline via rotates, to gather similar things together.
+ // Now we sort along the spine via rotates, to gather similar things together.
// Do we rotate (x + y) + z
// into (x + z) + y ?
- if( spline_cmp(lhs.in(2),rhs) )
+ if( spine_cmp(lhs.in(2),rhs) )
return new AddNode(new AddNode(lhs.in(1),rhs).peephole(),lhs.in(2));
return null;
@@ -131,12 +131,12 @@ public class AddNode extends Node {
return op instanceof PhiNode phi && phi.allCons() ? phi : null;
}
- // Compare two off-spline nodes and decide what order they should be in.
+ // Compare two off-spine nodes and decide what order they should be in.
// Do we rotate ((x + hi) + lo) into ((x + lo) + hi) ?
// Generally constants always go right, then Phi-of-constants, then muls, then others.
// Ties with in a category sort by node ID.
// TRUE if swapping hi and lo.
- static boolean spline_cmp( Node hi, Node lo ) {
+ static boolean spine_cmp( Node hi, Node lo ) {
if( lo._type.isConstant() ) return false;
if( hi._type.isConstant() ) return true ;
diff --git a/chapter06/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter06/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index a9ec6838..79c65c60 100644
--- a/chapter06/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter06/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -43,9 +43,10 @@ abstract public class BoolNode extends Node {
if( in(1)==in(2) )
return new ConstantNode(TypeInteger.constant(doOp(3,3)?1:0));
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
+ // No rotate: compares are not associative.
Node phicon = AddNode.phiCon(this,false);
if( phicon!=null ) return phicon;
diff --git a/chapter07/src/main/java/com/seaofnodes/simple/node/AddNode.java b/chapter07/src/main/java/com/seaofnodes/simple/node/AddNode.java
index 8f3e5a98..85d9a593 100644
--- a/chapter07/src/main/java/com/seaofnodes/simple/node/AddNode.java
+++ b/chapter07/src/main/java/com/seaofnodes/simple/node/AddNode.java
@@ -66,7 +66,7 @@ public class AddNode extends Node {
// Now we might see (add add non) or (add non non) but never (add non add) nor (add add add)
if( !(lhs instanceof AddNode) )
// Rotate; look for (add (phi cons) con/(phi cons))
- return spline_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
+ return spine_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
// Now we only see (add add non)
@@ -82,11 +82,11 @@ public class AddNode extends Node {
Node phicon = phiCon(this,true);
if( phicon!=null ) return phicon;
- // Now we sort along the spline via rotates, to gather similar things together.
+ // Now we sort along the spine via rotates, to gather similar things together.
// Do we rotate (x + y) + z
// into (x + z) + y ?
- if( spline_cmp(lhs.in(2),rhs) )
+ if( spine_cmp(lhs.in(2),rhs) )
return new AddNode(new AddNode(lhs.in(1),rhs).peephole(),lhs.in(2));
return null;
@@ -133,12 +133,12 @@ public class AddNode extends Node {
return op instanceof PhiNode phi && phi.allCons() ? phi : null;
}
- // Compare two off-spline nodes and decide what order they should be in.
+ // Compare two off-spine nodes and decide what order they should be in.
// Do we rotate ((x + hi) + lo) into ((x + lo) + hi) ?
// Generally constants always go right, then Phi-of-constants, then muls, then others.
// Ties with in a category sort by node ID.
// TRUE if swapping hi and lo.
- static boolean spline_cmp( Node hi, Node lo ) {
+ static boolean spine_cmp( Node hi, Node lo ) {
if( lo._type.isConstant() ) return false;
if( hi._type.isConstant() ) return true ;
diff --git a/chapter07/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter07/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 0c32d50d..5948a1d3 100644
--- a/chapter07/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter07/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -45,9 +45,10 @@ abstract public class BoolNode extends Node {
if( in(1)==in(2) )
return new ConstantNode(TypeInteger.constant(doOp(3,3)?1:0));
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
+ // No rotate: compares are not associative.
Node phicon = AddNode.phiCon(this,false);
if( phicon!=null ) return phicon;
diff --git a/chapter08/src/main/java/com/seaofnodes/simple/node/AddNode.java b/chapter08/src/main/java/com/seaofnodes/simple/node/AddNode.java
index 84a368fd..0c66422d 100644
--- a/chapter08/src/main/java/com/seaofnodes/simple/node/AddNode.java
+++ b/chapter08/src/main/java/com/seaofnodes/simple/node/AddNode.java
@@ -66,7 +66,7 @@ public class AddNode extends Node {
// Now we might see (add add non) or (add non non) but never (add non add) nor (add add add)
if( !(lhs instanceof AddNode) )
// Rotate; look for (add (phi cons) con/(phi cons))
- return spline_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
+ return spine_cmp(lhs,rhs) ? swap12() : phiCon(this,true);
// Now we only see (add add non)
@@ -87,11 +87,11 @@ public class AddNode extends Node {
Node phicon = phiCon(this,true);
if( phicon!=null ) return phicon;
- // Now we sort along the spline via rotates, to gather similar things together.
+ // Now we sort along the spine via rotates, to gather similar things together.
// Do we rotate (x + y) + z
// into (x + z) + y ?
- if( spline_cmp(lhs.in(2),rhs) )
+ if( spine_cmp(lhs.in(2),rhs) )
return new AddNode(new AddNode(lhs.in(1),rhs).peephole(),lhs.in(2));
return null;
@@ -138,12 +138,12 @@ public class AddNode extends Node {
return op instanceof PhiNode phi && phi.allCons() ? phi : null;
}
- // Compare two off-spline nodes and decide what order they should be in.
+ // Compare two off-spine nodes and decide what order they should be in.
// Do we rotate ((x + hi) + lo) into ((x + lo) + hi) ?
// Generally constants always go right, then Phi-of-constants, then muls, then others.
// Ties with in a category sort by node ID.
// TRUE if swapping hi and lo.
- static boolean spline_cmp( Node hi, Node lo ) {
+ static boolean spine_cmp( Node hi, Node lo ) {
if( lo._type.isConstant() ) return false;
if( hi._type.isConstant() ) return true ;
diff --git a/chapter08/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter08/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 0c32d50d..5948a1d3 100644
--- a/chapter08/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter08/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -45,9 +45,10 @@ abstract public class BoolNode extends Node {
if( in(1)==in(2) )
return new ConstantNode(TypeInteger.constant(doOp(3,3)?1:0));
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
+ // No rotate: compares are not associative.
Node phicon = AddNode.phiCon(this,false);
if( phicon!=null ) return phicon;
diff --git a/chapter09/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter09/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index d3fcec95..ee643bf5 100644
--- a/chapter09/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter09/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -44,9 +44,10 @@ abstract public class BoolNode extends Node {
if( in(1)==in(2) )
return new ConstantNode(TypeInteger.constant(doOp(3,3)?1:0));
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
+ // No rotate: compares are not associative.
Node phicon = AddNode.phiCon(this,false);
if( phicon!=null ) return phicon;
diff --git a/chapter10/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter10/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 9c15f01b..8719e4d5 100644
--- a/chapter10/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter10/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -60,9 +60,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter11/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter11/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 9c15f01b..8719e4d5 100644
--- a/chapter11/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter11/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -60,9 +60,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter12/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter12/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index a31bd963..f202b263 100644
--- a/chapter12/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter12/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -67,9 +67,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter13/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter13/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index a31bd963..f202b263 100644
--- a/chapter13/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter13/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -67,9 +67,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter15/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter15/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index aa9fd312..06c10a79 100644
--- a/chapter15/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter15/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -69,9 +69,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter16/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter16/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index aa9fd312..06c10a79 100644
--- a/chapter16/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter16/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -69,9 +69,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter17/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter17/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index aa9fd312..06c10a79 100644
--- a/chapter17/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter17/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -69,9 +69,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter18/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter18/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 83893968..dc57f7b4 100644
--- a/chapter18/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter18/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -70,9 +70,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter19/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter19/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 93e5e4e9..0d255cb2 100644
--- a/chapter19/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter19/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -69,9 +69,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter20/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter20/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index e6b87ce8..3f959e75 100644
--- a/chapter20/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter20/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -71,9 +71,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter21/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter21/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index fd6448a2..5f96c591 100644
--- a/chapter21/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter21/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -71,9 +71,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter22/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter22/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 301e1517..0cf8b87e 100644
--- a/chapter22/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter22/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -71,9 +71,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter23/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter23/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 2765c308..513f8d31 100644
--- a/chapter23/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter23/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -71,9 +71,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter24/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter24/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index 2765c308..513f8d31 100644
--- a/chapter24/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter24/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -71,9 +71,9 @@ abstract public class BoolNode extends Node {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;
diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index c8722f67..ef71983e 100644
--- a/chapter25/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter25/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -102,9 +102,9 @@ abstract public class BoolNode extends Node implements ModeNode {
return new NotNode(in(1));
}
- // Do we have ((x * (phi cons)) * con) ?
- // Do we have ((x * (phi cons)) * (phi cons)) ?
- // Push constant up through the phi: x * (phi con0*con0 con1*con1...)
+ // Do we have ((phi cons) cmp con) ?
+ // Do we have ((phi cons) cmp (phi cons)) ?
+ // Push the compare up through the phi: (phi con0 cmp con, con1 cmp con...)
Node phicon = AddNode.phiCon(this,this instanceof EQ);
if( phicon!=null ) return phicon;