use of org.graalvm.compiler.asm.aarch64.AArch64Assembler.ConditionFlag in project graal by oracle.
the class AArch64LIRGenerator method emitCompareBranch.
@Override
public void emitCompareBranch(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
boolean mirrored = emitCompare(cmpKind, left, right, cond, unorderedIsTrue);
Condition finalCondition = mirrored ? cond.mirror() : cond;
boolean finalUnorderedIsTrue = mirrored ? !unorderedIsTrue : unorderedIsTrue;
ConditionFlag cmpCondition = toConditionFlag(((AArch64Kind) cmpKind).isInteger(), finalCondition, finalUnorderedIsTrue);
append(new BranchOp(cmpCondition, trueDestination, falseDestination, trueDestinationProbability));
}
use of org.graalvm.compiler.asm.aarch64.AArch64Assembler.ConditionFlag in project graal by oracle.
the class AArch64LIRGenerator method emitConditionalMove.
/**
* Conditionally move trueValue into new variable if cond + unorderedIsTrue is true, else
* falseValue.
*
* @param left Arbitrary value. Has to have same type as right. Non null.
* @param right Arbitrary value. Has to have same type as left. Non null.
* @param cond condition that decides whether to move trueValue or falseValue into result. Non
* null.
* @param unorderedIsTrue defines whether floating-point comparisons consider unordered true or
* not. Ignored for integer comparisons.
* @param trueValue arbitrary value same type as falseValue. Non null.
* @param falseValue arbitrary value same type as trueValue. Non null.
* @return value containing trueValue if cond + unorderedIsTrue is true, else falseValue. Non
* null.
*/
@Override
public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) {
boolean mirrored = emitCompare(cmpKind, left, right, cond, unorderedIsTrue);
Condition finalCondition = mirrored ? cond.mirror() : cond;
boolean finalUnorderedIsTrue = mirrored ? !unorderedIsTrue : unorderedIsTrue;
ConditionFlag cmpCondition = toConditionFlag(((AArch64Kind) cmpKind).isInteger(), finalCondition, finalUnorderedIsTrue);
Variable result = newVariable(trueValue.getValueKind());
append(new CondMoveOp(result, cmpCondition, loadReg(trueValue), loadReg(falseValue)));
return result;
}
Aggregations