use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitLoad.
@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
AMD64AddressValue loadAddress = getAMD64LIRGen().asAddressValue(address);
Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
switch((AMD64Kind) kind.getPlatformKind()) {
case BYTE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
break;
case WORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
break;
case DWORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
break;
case QWORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOV, QWORD, result, loadAddress, state));
break;
case SINGLE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSS, SS, result, loadAddress, state));
break;
case DOUBLE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSD, SD, result, loadAddress, state));
break;
default:
throw GraalError.shouldNotReachHere();
}
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitBinaryConst.
private Variable emitBinaryConst(LIRKind resultKind, AMD64RRMOp op, OperandSize size, AllocatableValue a, JavaConstant b) {
Variable result = getLIRGen().newVariable(resultKind);
getLIRGen().append(new AMD64Binary.DataThreeOp(op, size, result, a, b));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitBinaryConst.
private Variable emitBinaryConst(LIRKind resultKind, AMD64RMOp op, OperandSize size, AllocatableValue a, JavaConstant b) {
Variable result = getLIRGen().newVariable(resultKind);
getLIRGen().append(new AMD64Binary.DataTwoOp(op, size, result, a, b));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitMathCos.
@Override
public Value emitMathCos(Value input) {
LIRGenerator gen = getLIRGen();
Variable result = maths.emitCos(gen, input);
if (result == null) {
result = gen.newVariable(LIRKind.combine(input));
AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), COS, result, gen.asAllocatable(input), stackSlot));
}
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitBinaryMemory.
public Value emitBinaryMemory(AMD64RRMOp op, OperandSize size, AllocatableValue a, AMD64AddressValue location, LIRFrameState state) {
Variable result = getLIRGen().newVariable(LIRKind.combine(a));
getLIRGen().append(new AMD64Binary.MemoryThreeOp(op, size, result, a, location, state));
return result;
}
Aggregations