Search in sources :

Example 1 with FMOVDCC

use of org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVDCC in project graal by oracle.

the class SPARCLIRGenerator method emitConditionalMove.

@Override
public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) {
    // Emit compare
    SPARCKind cmpSPARCKind = (SPARCKind) cmpKind;
    boolean mirrored = emitCompare(cmpSPARCKind, left, right);
    // Emit move
    Value actualTrueValue = trueValue;
    Value actualFalseValue = falseValue;
    SPARCKind valueKind = (SPARCKind) trueValue.getPlatformKind();
    CMOV cmove;
    if (valueKind.isFloat()) {
        // Floats cannot be immediate at all
        actualTrueValue = load(trueValue);
        actualFalseValue = load(falseValue);
        cmove = valueKind.equals(SINGLE) ? FMOVSCC : FMOVDCC;
    } else if (valueKind.isInteger()) {
        actualTrueValue = loadSimm11(trueValue);
        actualFalseValue = loadSimm11(falseValue);
        cmove = MOVicc;
    } else {
        throw GraalError.shouldNotReachHere();
    }
    Variable result = newVariable(trueValue.getValueKind());
    ConditionFlag finalCondition = SPARCControlFlow.fromCondition(cmpSPARCKind.isInteger(), mirrored ? cond.mirror() : cond, unorderedIsTrue);
    CC cc = CC.forKind(cmpSPARCKind);
    append(new CondMoveOp(cmove, cc, finalCondition, actualTrueValue, actualFalseValue, result));
    return result;
}
Also used : FMOVSCC(org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVSCC) CC(org.graalvm.compiler.asm.sparc.SPARCAssembler.CC) FMOVDCC(org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVDCC) Variable(org.graalvm.compiler.lir.Variable) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCImmediateAddressValue(org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) CondMoveOp(org.graalvm.compiler.lir.sparc.SPARCControlFlow.CondMoveOp) SPARCKind(jdk.vm.ci.sparc.SPARCKind) CMOV(org.graalvm.compiler.asm.sparc.SPARCAssembler.CMOV) ConditionFlag(org.graalvm.compiler.asm.sparc.SPARCAssembler.ConditionFlag)

Aggregations

AllocatableValue (jdk.vm.ci.meta.AllocatableValue)1 Value (jdk.vm.ci.meta.Value)1 SPARCKind (jdk.vm.ci.sparc.SPARCKind)1 CC (org.graalvm.compiler.asm.sparc.SPARCAssembler.CC)1 CMOV (org.graalvm.compiler.asm.sparc.SPARCAssembler.CMOV)1 ConditionFlag (org.graalvm.compiler.asm.sparc.SPARCAssembler.ConditionFlag)1 FMOVDCC (org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVDCC)1 FMOVSCC (org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVSCC)1 Variable (org.graalvm.compiler.lir.Variable)1 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)1 CondMoveOp (org.graalvm.compiler.lir.sparc.SPARCControlFlow.CondMoveOp)1 SPARCImmediateAddressValue (org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue)1