changeset 7743:7732a91e5f6d

Added more skeleton code to SPARC projects.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Feb 2013 18:31:00 +0100
parents 9f8bf17b2d33
children 437f43262915
files graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java
diffstat 4 files changed, 383 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Feb 07 18:01:08 2013 +0100
+++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Feb 07 18:31:00 2013 +0100
@@ -24,6 +24,7 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.asm.*;
+import com.oracle.graal.sparc.*;
 
 /**
  * This class implements an assembler that can encode most SPARC instructions.
@@ -33,6 +34,8 @@
     public SPARCAssembler(TargetDescription target) {
         super(target);
         // TODO Auto-generated constructor stub
+        @SuppressWarnings("unused")
+        SPARC sparc;
     }
 
     @Override
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Thu Feb 07 18:01:08 2013 +0100
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Thu Feb 07 18:31:00 2013 +0100
@@ -27,15 +27,352 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.gen.*;
 import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.sparc.*;
 import com.oracle.graal.nodes.*;
+import com.oracle.graal.nodes.calc.*;
+import com.oracle.graal.nodes.calc.ConvertNode.Op;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.nodes.java.*;
 
 /**
  * This class implements the SPARC specific portion of the LIR generator.
  */
-public abstract class SPARCLIRGenerator extends LIRGenerator {
+public class SPARCLIRGenerator extends LIRGenerator {
 
     public SPARCLIRGenerator(StructuredGraph graph, CodeCacheProvider runtime, TargetDescription target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir) {
         super(graph, runtime, target, frameMap, method, lir);
         // SPARC: Implement lir generator.
     }
+
+    @Override
+    public Variable emitMove(Value input) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected boolean peephole(ValueNode valueNode) {
+        // SPARC: Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    protected void emitReturn(Value input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected void emitNullCheckGuard(ValueNode object) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitJump(LabelRef label, LIRFrameState info) {
+        @SuppressWarnings("unused")
+        SPARCLIRInstruction instruction = null;
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitCompareBranch(Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRFrameState info) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitIntegerTestBranch(Value left, Value right, boolean negated, LabelRef label, LIRFrameState info) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public Variable emitConditionalMove(Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected void emitCall(RuntimeCallTarget callTarget, Value result, Value[] arguments, Value[] temps, Value targetAddress, LIRFrameState info) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected LabelRef createDeoptStub(DeoptimizationAction action, DeoptimizationReason reason, LIRFrameState info, Object deoptInfo) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected void emitSequentialSwitch(Constant[] keyConstants, LabelRef[] keyTargets, LabelRef defaultTarget, Value key) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected void emitSwitchRanges(int[] lowKeys, int[] highKeys, LabelRef[] targets, LabelRef defaultTarget, Value key) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitBitCount(Variable result, Value operand) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitBitScanForward(Variable result, Value operand) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitBitScanReverse(Variable result, Value operand) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathAbs(Variable result, Variable input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathSqrt(Variable result, Variable input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathLog(Variable result, Variable input, boolean base10) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathCos(Variable result, Variable input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathSin(Variable result, Variable input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitMathTan(Variable result, Variable input) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitByteSwap(Variable result, Value operand) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public boolean canInlineConstant(Constant c) {
+        // SPARC: Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean canStoreConstant(Constant c) {
+        // SPARC: Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public Address makeAddress(LocationNode location, ValueNode object) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void emitMove(Value src, Value dst) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public Value emitLoad(Value loadAddress, boolean canTrap) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void emitStore(Value storeAddress, Value input, boolean canTrap) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public Value emitLea(Value address) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitNegate(Value input) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitAdd(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitSub(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitMul(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitDiv(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitRem(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitUDiv(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitURem(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitAnd(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitOr(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitXor(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitShl(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitShr(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitUShr(Value a, Value b) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Value emitConvert(Op opcode, Value inputVal) {
+        // SPARC: Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void emitMembar(int barriers) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitDeoptimizeOnOverflow(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void emitDeoptimize(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void visitCompareAndSwap(CompareAndSwapNode i) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void visitExceptionObject(ExceptionObjectNode i) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void visitSafepointNode(SafepointNode i) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
+    public void visitBreakpointNode(BreakpointNode i) {
+        // SPARC: Auto-generated method stub
+
+    }
 }
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java	Thu Feb 07 18:01:08 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java	Thu Feb 07 18:31:00 2013 +0100
@@ -25,6 +25,7 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.gen.*;
+import com.oracle.graal.compiler.sparc.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 import com.oracle.graal.lir.*;
@@ -42,8 +43,7 @@
 
     @Override
     public LIRGenerator newLIRGenerator(StructuredGraph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir) {
-        // SPARC: Add LIR generator.
-        return null;
+        return new SPARCLIRGenerator(graph, this.runtime(), this.target, frameMap, method, lir);
     }
 
     @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java	Thu Feb 07 18:31:00 2013 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.lir.sparc;
+
+import com.oracle.graal.asm.sparc.*;
+import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.asm.*;
+
+/**
+ * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
+ */
+public abstract class SPARCLIRInstruction extends LIRInstruction {
+
+    @Override
+    public final void emitCode(TargetMethodAssembler tasm) {
+        emitCode(tasm, (SPARCAssembler) tasm.asm);
+    }
+
+    public abstract void emitCode(TargetMethodAssembler tasm, SPARCAssembler masm);
+}