Search in sources :

Example 11 with SPARCKind

use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitUShr.

@Override
public Variable emitUShr(Value a, Value b) {
    SPARCKind aKind = (SPARCKind) a.getPlatformKind();
    LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
    Op3s op;
    switch(aKind) {
        case WORD:
            op = Op3s.Srl;
            break;
        case XWORD:
            op = Op3s.Srlx;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return emitBinary(resultKind, op, a, b);
}
Also used : Op3s(org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s) LIRKind(org.graalvm.compiler.core.common.LIRKind) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Example 12 with SPARCKind

use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitMathSqrt.

@Override
public Value emitMathSqrt(Value inputValue) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
    SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
    Opfs opf;
    switch(kind) {
        case SINGLE:
            opf = Opfs.Fsqrts;
            break;
        case DOUBLE:
            opf = Opfs.Fsqrtd;
            break;
        default:
            throw GraalError.shouldNotReachHere("Input kind: " + kind);
    }
    getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result));
    return result;
}
Also used : SPARCOPFOp(org.graalvm.compiler.lir.sparc.SPARCOPFOp) Variable(org.graalvm.compiler.lir.Variable) Opfs(org.graalvm.compiler.asm.sparc.SPARCAssembler.Opfs) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Example 13 with SPARCKind

use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.

the class SPARCLIRGenerator method emitIntegerTestBranch.

@Override
public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
    emitIntegerTest(left, right);
    append(new BranchOp(ConditionFlag.Equal, trueDestination, falseDestination, (SPARCKind) left.getPlatformKind(), trueDestinationProbability));
}
Also used : BranchOp(org.graalvm.compiler.lir.sparc.SPARCControlFlow.BranchOp) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Example 14 with SPARCKind

use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.

the class SPARCNodeMatchRules method emitZeroExtendMemory.

private ComplexMatchResult emitZeroExtendMemory(Access access, int fromBits, int toBits) {
    assert fromBits <= toBits && toBits <= 64;
    SPARCKind toKind = null;
    SPARCKind fromKind = null;
    if (fromBits == toBits) {
        return null;
    }
    toKind = toBits > 32 ? XWORD : WORD;
    switch(fromBits) {
        case 8:
            fromKind = BYTE;
            break;
        case 16:
            fromKind = HWORD;
            break;
        case 32:
            fromKind = WORD;
            break;
        default:
            throw GraalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
    }
    SPARCKind localFromKind = fromKind;
    SPARCKind localToKind = toKind;
    return builder -> {
        // Loads are always zero extending load
        return getLIRGeneratorTool().emitZeroExtendLoad(LIRKind.value(localFromKind), LIRKind.value(localToKind), operand(access.getAddress()), getState(access));
    };
}
Also used : CompareNode(org.graalvm.compiler.nodes.calc.CompareNode) LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) XWORD(jdk.vm.ci.sparc.SPARCKind.XWORD) LabelRef(org.graalvm.compiler.lir.LabelRef) SPARCKind(jdk.vm.ci.sparc.SPARCKind) WORD(jdk.vm.ci.sparc.SPARCKind.WORD) SignExtendNode(org.graalvm.compiler.nodes.calc.SignExtendNode) ZeroExtendNode(org.graalvm.compiler.nodes.calc.ZeroExtendNode) Condition(org.graalvm.compiler.core.common.calc.Condition) HWORD(jdk.vm.ci.sparc.SPARCKind.HWORD) IfNode(org.graalvm.compiler.nodes.IfNode) LIRKind(org.graalvm.compiler.core.common.LIRKind) LIRLowerableAccess(org.graalvm.compiler.nodes.memory.LIRLowerableAccess) BYTE(jdk.vm.ci.sparc.SPARCKind.BYTE) DeoptimizingNode(org.graalvm.compiler.nodes.DeoptimizingNode) CanonicalCondition(org.graalvm.compiler.core.common.calc.CanonicalCondition) JavaConstant(jdk.vm.ci.meta.JavaConstant) ValueNode(org.graalvm.compiler.nodes.ValueNode) Value(jdk.vm.ci.meta.Value) ComplexMatchResult(org.graalvm.compiler.core.match.ComplexMatchResult) Access(org.graalvm.compiler.nodes.memory.Access) NodeMatchRules(org.graalvm.compiler.core.gen.NodeMatchRules) GraalError(org.graalvm.compiler.debug.GraalError) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) MatchRule(org.graalvm.compiler.core.match.MatchRule) LogicCompareAndSwapNode(org.graalvm.compiler.nodes.java.LogicCompareAndSwapNode) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Example 15 with SPARCKind

use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.

the class SPARCNodeMatchRules method emitSignExtendMemory.

private ComplexMatchResult emitSignExtendMemory(Access access, int fromBits, int toBits) {
    assert fromBits <= toBits && toBits <= 64;
    SPARCKind toKind = null;
    SPARCKind fromKind = null;
    if (fromBits == toBits) {
        return null;
    }
    toKind = toBits > 32 ? XWORD : WORD;
    switch(fromBits) {
        case 8:
            fromKind = BYTE;
            break;
        case 16:
            fromKind = HWORD;
            break;
        case 32:
            fromKind = WORD;
            break;
        default:
            throw GraalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
    }
    SPARCKind localFromKind = fromKind;
    SPARCKind localToKind = toKind;
    return builder -> {
        return getLIRGeneratorTool().emitSignExtendLoad(LIRKind.value(localFromKind), LIRKind.value(localToKind), operand(access.getAddress()), getState(access));
    };
}
Also used : CompareNode(org.graalvm.compiler.nodes.calc.CompareNode) LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) XWORD(jdk.vm.ci.sparc.SPARCKind.XWORD) LabelRef(org.graalvm.compiler.lir.LabelRef) SPARCKind(jdk.vm.ci.sparc.SPARCKind) WORD(jdk.vm.ci.sparc.SPARCKind.WORD) SignExtendNode(org.graalvm.compiler.nodes.calc.SignExtendNode) ZeroExtendNode(org.graalvm.compiler.nodes.calc.ZeroExtendNode) Condition(org.graalvm.compiler.core.common.calc.Condition) HWORD(jdk.vm.ci.sparc.SPARCKind.HWORD) IfNode(org.graalvm.compiler.nodes.IfNode) LIRKind(org.graalvm.compiler.core.common.LIRKind) LIRLowerableAccess(org.graalvm.compiler.nodes.memory.LIRLowerableAccess) BYTE(jdk.vm.ci.sparc.SPARCKind.BYTE) DeoptimizingNode(org.graalvm.compiler.nodes.DeoptimizingNode) CanonicalCondition(org.graalvm.compiler.core.common.calc.CanonicalCondition) JavaConstant(jdk.vm.ci.meta.JavaConstant) ValueNode(org.graalvm.compiler.nodes.ValueNode) Value(jdk.vm.ci.meta.Value) ComplexMatchResult(org.graalvm.compiler.core.match.ComplexMatchResult) Access(org.graalvm.compiler.nodes.memory.Access) NodeMatchRules(org.graalvm.compiler.core.gen.NodeMatchRules) GraalError(org.graalvm.compiler.debug.GraalError) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) MatchRule(org.graalvm.compiler.core.match.MatchRule) LogicCompareAndSwapNode(org.graalvm.compiler.nodes.java.LogicCompareAndSwapNode) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Aggregations

SPARCKind (jdk.vm.ci.sparc.SPARCKind)15 Variable (org.graalvm.compiler.lir.Variable)6 Value (jdk.vm.ci.meta.Value)5 LIRKind (org.graalvm.compiler.core.common.LIRKind)5 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)5 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)4 Op3s (org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s)3 Condition (org.graalvm.compiler.core.common.calc.Condition)3 BranchOp (org.graalvm.compiler.lir.sparc.SPARCControlFlow.BranchOp)3 JavaConstant (jdk.vm.ci.meta.JavaConstant)2 BYTE (jdk.vm.ci.sparc.SPARCKind.BYTE)2 HWORD (jdk.vm.ci.sparc.SPARCKind.HWORD)2 WORD (jdk.vm.ci.sparc.SPARCKind.WORD)2 XWORD (jdk.vm.ci.sparc.SPARCKind.XWORD)2 ConditionFlag (org.graalvm.compiler.asm.sparc.SPARCAssembler.ConditionFlag)2 Opfs (org.graalvm.compiler.asm.sparc.SPARCAssembler.Opfs)2 CanonicalCondition (org.graalvm.compiler.core.common.calc.CanonicalCondition)2 NodeMatchRules (org.graalvm.compiler.core.gen.NodeMatchRules)2 ComplexMatchResult (org.graalvm.compiler.core.match.ComplexMatchResult)2 MatchRule (org.graalvm.compiler.core.match.MatchRule)2