use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class ReadRegisterNode method generate.
@Override
public void generate(NodeLIRBuilderTool generator) {
LIRKind kind = generator.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
Value result = register.asValue(kind);
if (incoming) {
generator.getLIRGeneratorTool().emitIncomingValues(new Value[] { result });
}
if (!directUse) {
result = generator.getLIRGeneratorTool().emitMove(result);
}
generator.setResult(this, result);
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitIDIV.
private AMD64MulDivOp emitIDIV(OperandSize size, Value a, Value b, LIRFrameState state) {
LIRKind kind = LIRKind.combine(a, b);
AMD64SignExtendOp sx = getLIRGen().append(new AMD64SignExtendOp(size, kind, moveToReg(AMD64.rax, a)));
return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.IDIV, size, kind, sx.getHighResult(), sx.getLowResult(), getLIRGen().asAllocatable(b), state));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitOr.
@Override
public Variable emitOr(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, OR, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, OR, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitAnd.
@Override
public Variable emitAnd(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, AND, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, AND, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitDIV.
private AMD64MulDivOp emitDIV(OperandSize size, Value a, Value b, LIRFrameState state) {
LIRKind kind = LIRKind.combine(a, b);
RegisterValue rax = moveToReg(AMD64.rax, a);
RegisterValue rdx = AMD64.rdx.asValue(kind);
getLIRGen().append(new AMD64ClearRegisterOp(size, rdx));
return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.DIV, size, kind, rdx, rax, getLIRGen().asAllocatable(b), state));
}
Aggregations