use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitReinterpret.
@Override
public Value emitReinterpret(LIRKind to, Value inputVal) {
ValueKind<?> from = inputVal.getValueKind();
if (to.equals(from)) {
return inputVal;
}
Variable result = getLIRGen().newVariable(to);
getLIRGen().append(new AArch64ReinterpretOp(result, getLIRGen().asAllocatable(inputVal)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitCountTrailingZeros.
@Override
public Value emitCountTrailingZeros(Value value) {
Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD));
getLIRGen().append(new AArch64BitManipulationOp(CTZ, result, getLIRGen().asAllocatable(value)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitUnary.
private Variable emitUnary(AArch64ArithmeticOp op, Value inputVal) {
AllocatableValue input = getLIRGen().asAllocatable(inputVal);
Variable result = getLIRGen().newVariable(LIRKind.combine(input));
getLIRGen().append(new AArch64ArithmeticOp.UnaryOp(op, result, input));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitExtendMemory.
public Value emitExtendMemory(boolean isSigned, AArch64Kind memoryKind, int resultBits, AArch64AddressValue address, LIRFrameState state) {
// Issue a zero extending load of the proper bit size and set the result to
// the proper kind.
Variable result = getLIRGen().newVariable(LIRKind.value(resultBits == 32 ? AArch64Kind.DWORD : AArch64Kind.QWORD));
int targetSize = resultBits <= 32 ? 32 : 64;
switch(memoryKind) {
case BYTE:
case WORD:
case DWORD:
case QWORD:
getLIRGen().append(new AArch64Unary.MemoryOp(isSigned, targetSize, memoryKind.getSizeInBytes() * 8, result, address, state));
break;
default:
throw GraalError.shouldNotReachHere();
}
return result;
}
use of org.graalvm.compiler.lir.Variable 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