use of org.graalvm.compiler.nodes.calc.SignedDivNode in project graal by oracle.
the class AArch64IntegerArithmeticSnippets method lower.
public void lower(FixedBinaryNode node, LoweringTool tool) {
JavaKind kind = node.stamp(NodeView.DEFAULT).getStackKind();
assert kind == JavaKind.Int || kind == JavaKind.Long;
SnippetTemplate.SnippetInfo snippet;
if (node instanceof SafeNode) {
// We already introduced the zero division check, nothing to do.
return;
} else if (node instanceof SignedDivNode) {
snippet = kind == JavaKind.Int ? idiv : ldiv;
} else if (node instanceof SignedRemNode) {
snippet = kind == JavaKind.Int ? irem : lrem;
} else if (node instanceof UnsignedDivNode) {
snippet = kind == JavaKind.Int ? uidiv : uldiv;
} else if (node instanceof UnsignedRemNode) {
snippet = kind == JavaKind.Int ? uirem : ulrem;
} else {
throw GraalError.shouldNotReachHere();
}
StructuredGraph graph = node.graph();
Arguments args = new Arguments(snippet, graph.getGuardsStage(), tool.getLoweringStage());
args.add("x", node.getX());
args.add("y", node.getY());
template(node, args).instantiate(providers.getMetaAccess(), node, SnippetTemplate.DEFAULT_REPLACER, args);
}
Aggregations