use of org.graalvm.compiler.lir.aarch64.AArch64Move.CompareAndSwapOp in project graal by oracle.
the class AArch64LIRGenerator method emitValueCompareAndSwap.
@Override
public Variable emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
Variable result = newVariable(newValue.getValueKind());
Variable scratch = newVariable(LIRKind.value(AArch64Kind.WORD));
append(new CompareAndSwapOp(result, loadNonCompareConst(expectedValue), loadReg(newValue), asAllocatable(address), scratch));
return result;
}
use of org.graalvm.compiler.lir.aarch64.AArch64Move.CompareAndSwapOp in project graal by oracle.
the class AArch64LIRGenerator method emitLogicCompareAndSwap.
@Override
public Variable emitLogicCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
Variable prevValue = newVariable(expectedValue.getValueKind());
Variable scratch = newVariable(LIRKind.value(AArch64Kind.DWORD));
append(new CompareAndSwapOp(prevValue, loadReg(expectedValue), loadReg(newValue), asAllocatable(address), scratch));
assert trueValue.getValueKind().equals(falseValue.getValueKind());
Variable result = newVariable(trueValue.getValueKind());
append(new CondMoveOp(result, ConditionFlag.EQ, asAllocatable(trueValue), asAllocatable(falseValue)));
return result;
}
Aggregations