diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java @ 5657:d71eb56d6bb0

new stamp inference in CanonicalizerPhase, IntegerStamp.mask
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 19 Jun 2012 20:03:06 +0200
parents 5ad40c8ba3ed
children 5e3d1a68664e
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java	Tue Jun 19 17:12:02 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NegateNode.java	Tue Jun 19 20:03:06 2012 +0200
@@ -37,13 +37,18 @@
         return x;
     }
 
+    @Override
+    public boolean inferStamp() {
+        return updateStamp(StampTool.negate(x().stamp()));
+    }
+
     /**
      * Creates new NegateNode instance.
      *
      * @param x the instruction producing the value that is input to this instruction
      */
     public NegateNode(ValueNode x) {
-        super(x.stamp() instanceof IntegerStamp ? StampFactory.negate((IntegerStamp) x.stamp()) : StampFactory.forKind(x.kind()));
+        super(StampTool.negate(x.stamp()));
         this.x = x;
     }