use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64HotSpotMaths method emitLog.
@Override
public Variable emitLog(LIRGenerator gen, Value input, boolean base10) {
if (GraalArithmeticStubs.getValue(gen.getResult().getLIR().getOptions())) {
return null;
}
Variable result = gen.newVariable(LIRKind.combine(input));
gen.append(new AMD64HotSpotMathIntrinsicOp(base10 ? LOG10 : LOG, result, gen.asAllocatable(input)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64HotSpotMaths method emitSin.
@Override
public Variable emitSin(LIRGenerator gen, Value input) {
if (GraalArithmeticStubs.getValue(gen.getResult().getLIR().getOptions())) {
return null;
}
Variable result = gen.newVariable(LIRKind.combine(input));
gen.append(new AMD64HotSpotMathIntrinsicOp(SIN, result, gen.asAllocatable(input)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64HotSpotNodeLIRBuilder method emitJumpToExceptionHandlerInCaller.
@Override
public void emitJumpToExceptionHandlerInCaller(ValueNode handlerInCallerPc, ValueNode exception, ValueNode exceptionPc) {
Variable handler = gen.load(operand(handlerInCallerPc));
ForeignCallLinkage linkage = gen.getForeignCalls().lookupForeignCall(EXCEPTION_HANDLER_IN_CALLER);
CallingConvention outgoingCc = linkage.getOutgoingCallingConvention();
assert outgoingCc.getArgumentCount() == 2;
RegisterValue exceptionFixed = (RegisterValue) outgoingCc.getArgument(0);
RegisterValue exceptionPcFixed = (RegisterValue) outgoingCc.getArgument(1);
gen.emitMove(exceptionFixed, operand(exception));
gen.emitMove(exceptionPcFixed, operand(exceptionPc));
Register thread = getGen().getProviders().getRegisters().getThreadRegister();
AMD64HotSpotJumpToExceptionHandlerInCallerOp op = new AMD64HotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed, getGen().config.threadIsMethodHandleReturnOffset, thread);
append(op);
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitShift.
private Variable emitShift(AMD64Shift op, OperandSize size, Value a, Value b) {
Variable result = getLIRGen().newVariable(LIRKind.combine(a, b).changeType(a.getPlatformKind()));
AllocatableValue input = getLIRGen().asAllocatable(a);
if (isJavaConstant(b)) {
JavaConstant c = asJavaConstant(b);
if (c.asLong() == 1) {
getLIRGen().append(new AMD64Unary.MOp(op.m1Op, size, result, input));
} else {
/*
* c is implicitly masked to 5 or 6 bits by the CPU, so casting it to (int) is
* always correct, even without the NumUtil.is32bit() test.
*/
getLIRGen().append(new AMD64Binary.ConstOp(op.miOp, size, result, input, (int) c.asLong()));
}
} else {
getLIRGen().emitMove(RCX_I, b);
getLIRGen().append(new AMD64ShiftOp(op.mcOp, size, result, input, RCX_I));
}
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitBaseOffsetLea.
private Variable emitBaseOffsetLea(LIRKind resultKind, Value base, int offset, OperandSize size) {
Variable result = getLIRGen().newVariable(resultKind);
AMD64AddressValue address = new AMD64AddressValue(resultKind, getLIRGen().asAllocatable(base), offset);
getLIRGen().append(new AMD64Move.LeaOp(result, address, size));
return result;
}
Aggregations