use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method moveBetweenFpGp.
private void moveBetweenFpGp(AllocatableValue dst, AllocatableValue src) {
AllocatableValue tempSlot;
PlatformKind dstKind = dst.getPlatformKind();
PlatformKind srcKind = src.getPlatformKind();
if (getLIRGen().getArchitecture().getFeatures().contains(CPUFeature.VIS3) && !(srcKind == WORD && dstKind == SINGLE) && !(srcKind == SINGLE && dstKind == WORD)) {
tempSlot = AllocatableValue.ILLEGAL;
} else {
tempSlot = getTempSlot(LIRKind.value(XWORD));
}
getLIRGen().append(new MoveFpGp(dst, src, tempSlot));
}
use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.
the class JVMCIInfopointErrorTest method testInvalidShortOop.
@Test(expected = Error.class)
public void testInvalidShortOop() {
test((tool, state, safepoint) -> {
PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
LIRKind lirKind = LIRKind.reference(kind);
Variable var = tool.newVariable(lirKind);
tool.append(new ValueDef(var));
safepoint.accept(state);
tool.append(new ValueUse(var));
});
}
use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.
the class LIRGenerator method createZapRegisters.
@Override
public SaveRegistersOp createZapRegisters() {
Register[] zappedRegisters = getResult().getFrameMap().getRegisterConfig().getAllocatableRegisters().toArray();
JavaConstant[] zapValues = new JavaConstant[zappedRegisters.length];
for (int i = 0; i < zappedRegisters.length; i++) {
PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory());
zapValues[i] = zapValueForKind(kind);
}
return createZapRegisters(zappedRegisters, zapValues);
}
use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.
the class LIRGenerator method zapArgumentSpace.
@Override
public LIRInstruction zapArgumentSpace() {
List<StackSlot> slots = null;
for (AllocatableValue arg : res.getCallingConvention().getArguments()) {
if (isStackSlot(arg)) {
if (slots == null) {
slots = new ArrayList<>();
}
slots.add((StackSlot) arg);
} else {
assert !isVirtualStackSlot(arg);
}
}
if (slots == null) {
return null;
}
StackSlot[] zappedStack = slots.toArray(new StackSlot[slots.size()]);
JavaConstant[] zapValues = new JavaConstant[zappedStack.length];
for (int i = 0; i < zappedStack.length; i++) {
PlatformKind kind = zappedStack[i].getPlatformKind();
zapValues[i] = zapValueForKind(kind);
}
return createZapArgumentSpace(zappedStack, zapValues);
}
use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.
the class NodeLIRBuilder method emitConditional.
public Variable emitConditional(LogicNode node, Value trueValue, Value falseValue) {
if (node instanceof IsNullNode) {
IsNullNode isNullNode = (IsNullNode) node;
LIRKind kind = gen.getLIRKind(isNullNode.getValue().stamp(NodeView.DEFAULT));
Value nullValue = gen.emitConstant(kind, JavaConstant.NULL_POINTER);
return gen.emitConditionalMove(kind.getPlatformKind(), operand(isNullNode.getValue()), nullValue, Condition.EQ, false, trueValue, falseValue);
} else if (node instanceof CompareNode) {
CompareNode compare = (CompareNode) node;
PlatformKind kind = gen.getLIRKind(compare.getX().stamp(NodeView.DEFAULT)).getPlatformKind();
return gen.emitConditionalMove(kind, operand(compare.getX()), operand(compare.getY()), compare.condition().asCondition(), compare.unorderedIsTrue(), trueValue, falseValue);
} else if (node instanceof LogicConstantNode) {
return gen.emitMove(((LogicConstantNode) node).getValue() ? trueValue : falseValue);
} else if (node instanceof IntegerTestNode) {
IntegerTestNode test = (IntegerTestNode) node;
return gen.emitIntegerTestMove(operand(test.getX()), operand(test.getY()), trueValue, falseValue);
} else {
throw GraalError.unimplemented(node.toString());
}
}
Aggregations