use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64LIRGenerator method emitIntegerTestMove.
@Override
public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {
emitIntegerTest(left, right);
Variable result = newVariable(trueValue.getValueKind());
append(new CondMoveOp(result, Condition.EQ, load(trueValue), loadNonConst(falseValue)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64LIRGenerator method emitAtomicReadAndWrite.
@Override
public Value emitAtomicReadAndWrite(Value address, Value newValue) {
ValueKind<?> kind = newValue.getValueKind();
Variable result = newVariable(kind);
AMD64AddressValue addressValue = asAddressValue(address);
append(new AMD64Move.AtomicReadAndWriteOp((AMD64Kind) kind.getPlatformKind(), result, addressValue, asAllocatable(newValue)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitBitScanReverse.
@Override
public Value emitBitScanReverse(Value value) {
Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD));
getLIRGen().append(new AArch64BitManipulationOp(BSR, result, getLIRGen().asAllocatable(value)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitSignExtend.
@Override
public Value emitSignExtend(Value inputVal, int fromBits, int toBits) {
LIRKind resultKind = getResultLirKind(toBits, inputVal);
assert fromBits <= toBits && toBits <= 64;
if (fromBits == toBits) {
return inputVal;
} else if (isJavaConstant(inputVal)) {
JavaConstant javaConstant = asJavaConstant(inputVal);
long constant;
if (javaConstant.isNull()) {
constant = 0;
} else {
constant = javaConstant.asLong();
}
int shiftCount = QWORD.getSizeInBytes() * 8 - fromBits;
return new ConstantValue(resultKind, JavaConstant.forLong((constant << shiftCount) >> shiftCount));
}
Variable result = getLIRGen().newVariable(resultKind);
getLIRGen().append(new AArch64SignExtendOp(result, getLIRGen().asAllocatable(inputVal), fromBits, toBits));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AArch64ArithmeticLIRGenerator method emitFloatConvert.
@Override
public Value emitFloatConvert(FloatConvert op, Value inputVal) {
PlatformKind resultPlatformKind = getFloatConvertResultKind(op);
LIRKind resultLirKind = LIRKind.combine(inputVal).changeType(resultPlatformKind);
Variable result = getLIRGen().newVariable(resultLirKind);
getLIRGen().append(new AArch64FloatConvertOp(op, result, getLIRGen().asAllocatable(inputVal)));
return result;
}
Aggregations