changeset 18682:0a109f5d5873

Add unwrap method to arithmetic operations.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 15 Dec 2014 19:15:39 +0100
parents 45f8b94b3b36
children 823f499a247c 2885aafd812f
files graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Mon Dec 15 18:51:08 2014 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Mon Dec 15 19:15:39 2014 +0100
@@ -354,6 +354,10 @@
          * Apply the operation to a {@link Stamp}.
          */
         public abstract Stamp foldStamp(Stamp stamp);
+
+        public UnaryOp<T> unwrap() {
+            return this;
+        }
     }
 
     /**
@@ -479,6 +483,10 @@
             return null;
         }
 
+        public BinaryOp<T> unwrap() {
+            return this;
+        }
+
         @Override
         public String toString() {
             if (associative) {
@@ -506,6 +514,11 @@
         public FloatConvert getFloatConvert() {
             return op;
         }
+
+        @Override
+        public FloatConvertOp unwrap() {
+            return this;
+        }
     }
 
     public abstract static class IntegerConvertOp<T> extends Op {
@@ -538,5 +551,9 @@
         public abstract Constant foldConstant(int inputBits, int resultBits, Constant value);
 
         public abstract Stamp foldStamp(int inputBits, int resultBits, Stamp stamp);
+
+        public IntegerConvertOp<T> unwrap() {
+            return this;
+        }
     }
 }