use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class ReinterpretNode method generate.
@Override
public void generate(NodeLIRBuilderTool builder, ArithmeticLIRGeneratorTool gen) {
LIRKind kind = builder.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
builder.setResult(this, gen.emitReinterpret(kind, builder.operand(getValue())));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class WriteReturnAddressNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
TargetDescription target = gen.getLIRGeneratorTool().target();
assert target.arch.getReturnAddressSize() > 0;
LIRKind wordKind = LIRKind.fromJavaKind(target.arch, target.wordJavaKind);
gen.getLIRGeneratorTool().emitMove(StackSlot.get(wordKind, -target.arch.getReturnAddressSize(), true), gen.operand(value));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class ReadRegisterFixedNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
LIRKind lirKind = tool.getLIRKind(FrameAccess.getWordStamp());
RegisterValue value = registerSupplier.apply(registerConfig).asValue(lirKind);
gen.setResult(this, tool.emitMove(value));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitUShr.
@Override
public Variable emitUShr(Value a, Value b) {
SPARCKind aKind = (SPARCKind) a.getPlatformKind();
LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
Op3s op;
switch(aKind) {
case WORD:
op = Op3s.Srl;
break;
case XWORD:
op = Op3s.Srlx;
break;
default:
throw GraalError.shouldNotReachHere();
}
return emitBinary(resultKind, op, a, b);
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitMul.
@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
LIRKind resultKind = LIRKind.combine(a, b);
PlatformKind aKind = a.getPlatformKind();
if (isNumericInteger(aKind)) {
if (setFlags) {
Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
if (aKind == XWORD) {
getLIRGen().append(new SPARCLMulccOp(result, getLIRGen().load(a), getLIRGen().load(b), getLIRGen()));
} else if (aKind == WORD) {
getLIRGen().append(new SPARCIMulccOp(result, getLIRGen().load(a), getLIRGen().load(b)));
} else {
throw GraalError.shouldNotReachHere();
}
return result;
} else {
return emitBinary(resultKind, Op3s.Mulx, a, b);
}
} else {
boolean isDouble = a.getPlatformKind().equals(DOUBLE);
return emitBinary(resultKind, isDouble ? Fmuld : Fmuls, a, b);
}
}
Aggregations