changeset 14848:b7948d5c0092

Remove remaining LIRGenerator methods from NodeLIRGenerator.
author Josef Eisl <josef.eisl@jku.at>
date Wed, 26 Mar 2014 17:02:13 +0100
parents c132602c640e
children 97a0878202c2
files graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java
diffstat 3 files changed, 7 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRGenerator.java	Wed Mar 26 16:31:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILNodeLIRGenerator.java	Wed Mar 26 17:02:13 2014 +0100
@@ -23,8 +23,6 @@
 
 package com.oracle.graal.compiler.hsail;
 
-import static com.oracle.graal.lir.hsail.HSAILBitManipulationOp.IntrinsicOpcode.*;
-
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.gen.*;
 import com.oracle.graal.debug.*;
@@ -60,31 +58,6 @@
     }
 
     @Override
-    public void emitBitCount(Variable result, Value value) {
-        if (value.getKind().getStackKind() == Kind.Int) {
-            append(new HSAILBitManipulationOp(IPOPCNT, result, value));
-        } else {
-            append(new HSAILBitManipulationOp(LPOPCNT, result, value));
-        }
-    }
-
-    @Override
-    public void emitBitScanForward(Variable result, Value value) {
-        throw GraalInternalError.unimplemented();
-    }
-
-    @Override
-    public void emitBitScanReverse(Variable result, Value value) {
-        throw GraalInternalError.unimplemented();
-    }
-
-    @Override
-    public void emitArrayEquals(Kind kind, Variable result, Value array1, Value array2, Value length) {
-        // TODO Auto-generated method stub
-        throw GraalInternalError.unimplemented();
-    }
-
-    @Override
     public void visitBreakpointNode(BreakpointNode node) {
         throw GraalInternalError.unimplemented();
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java	Wed Mar 26 16:31:28 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRGenerator.java	Wed Mar 26 17:02:13 2014 +0100
@@ -204,20 +204,6 @@
         return getDebugInfoBuilder().build(state, exceptionEdge);
     }
 
-    /**
-     * Gets the ABI specific operand used to return a value of a given kind from a method.
-     * 
-     * @param kind the kind of value being returned
-     * @return the operand representing the ABI defined location used return a value of kind
-     *         {@code kind}
-     */
-    public AllocatableValue resultOperandFor(Kind kind) {
-        if (kind == Kind.Void) {
-            return ILLEGAL;
-        }
-        return res.getFrameMap().registerConfig.getReturnRegister(kind).asValue(kind);
-    }
-
     final protected void append(LIRInstruction op) {
         if (printIRWithLIR && !TTY.isSuppressed()) {
             if (currentInstruction != null && lastInstructionPrinted != currentInstruction) {
@@ -429,7 +415,7 @@
     public void visitReturn(ReturnNode x) {
         AllocatableValue operand = ILLEGAL;
         if (x.result() != null) {
-            operand = resultOperandFor(x.result().getKind());
+            operand = gen.resultOperandFor(x.result().getKind());
             gen.emitMove(operand, operand(x.result()));
         }
         gen.emitReturn(operand);
@@ -686,23 +672,23 @@
         gen.emitOverflowCheckBranch(getLIRBlock(overflowSuccessor), getLIRBlock(next), probability);
     }
 
-    public void emitArrayEquals(Kind kind, Variable result, Value array1, Value array2, Value length) {
+    public final void emitArrayEquals(Kind kind, Variable result, Value array1, Value array2, Value length) {
         gen.emitArrayEquals(kind, result, array1, array2, length);
     }
 
-    public Variable newVariable(Kind i) {
+    public final Variable newVariable(Kind i) {
         return gen.newVariable(i);
     }
 
-    public void emitBitCount(Variable result, Value operand) {
+    public final void emitBitCount(Variable result, Value operand) {
         gen.emitBitCount(result, operand);
     }
 
-    public void emitBitScanForward(Variable result, Value operand) {
+    public final void emitBitScanForward(Variable result, Value operand) {
         gen.emitBitScanForward(result, operand);
     }
 
-    public void emitBitScanReverse(Variable result, Value operand) {
+    final void emitBitScanReverse(Variable result, Value operand) {
         gen.emitBitScanReverse(result, operand);
     }
 
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java	Wed Mar 26 16:31:28 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java	Wed Mar 26 17:02:13 2014 +0100
@@ -81,7 +81,7 @@
     @Override
     public void generate(NodeLIRGenerator gen) {
         Variable result = gen.newVariable(Kind.Int);
-        gen.emitBitScanReverse(result, gen.operand(value));
+        gen.getLIRGeneratorTool().emitBitScanReverse(result, gen.operand(value));
         gen.setResult(this, result);
     }