use of org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVSCC 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;
}
Aggregations