use of org.graalvm.compiler.replacements.nodes.arithmetic.IntegerMulHighNode in project graal by oracle.
the class TruffleGraphBuilderPlugins method registerExactMathPlugins.
public static void registerExactMathPlugins(InvocationPlugins plugins, MetaAccessProvider metaAccess) {
final ResolvedJavaType exactMathType = getRuntime().resolveType(metaAccess, "com.oracle.truffle.api.ExactMath");
Registration r = new Registration(plugins, new ResolvedJavaSymbol(exactMathType));
for (JavaKind kind : new JavaKind[] { JavaKind.Int, JavaKind.Long }) {
Class<?> type = kind.toJavaClass();
r.register2("multiplyHigh", type, type, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
b.addPush(kind, new IntegerMulHighNode(x, y));
return true;
}
});
r.register2("multiplyHighUnsigned", type, type, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
b.addPush(kind, new UnsignedMulHighNode(x, y));
return true;
}
});
}
}
Aggregations