[EXT] Re: [VectorAPI] Enhancement of floating-point math vector API implementation

Zhu, Yifan yzhu104 at UR.Rochester.edu
Fri Jan 6 23:16:01 UTC 2023


I see that you are vectorizing math kernels. Is there any claim on precision gap yet?

Yifan

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: panama-dev <panama-dev-retn at openjdk.org> on behalf of Vladimir Ivanov <vladimir.x.ivanov at oracle.com>
Sent: Friday, January 6, 2023 5:10:36 PM
To: Paul Sandoz <paul.sandoz at oracle.com>
Cc: Xiaohong Gong <Xiaohong.Gong at arm.com>; panama-dev at openjdk.java.net <panama-dev at openjdk.java.net>; nd <nd at arm.com>
Subject: [EXT] Re: [VectorAPI] Enhancement of floating-point math vector API implementation


>> As an idea for an incremental improvement, consider lifting native library linkage code from JVM into JDK code and refactor corresponding intrinsics (require new ones I believe) to accept the specialized entry point address of the correspoding vectorized math routine (instead of the operation code). Then C2 could use the address to generate direct leaf call into the stub.
>>
>> That would allow to make JVM code library-agnostic and abstract away all the differences between SVML and SLEEF libraries (and, in the future, any other library added as a backing implementation).
>>
>> On JDK level multiple plug-in implementations could be supported and the final decision what implementation to use is performed at runtime depending on the presence of required libraries or user choice.
>>
>
> Yes, users could plug in using service providers. We would need to be careful about potential abuses. Might need to be gated, perhaps by Panama’s command --enable-native-access flag.

Service provides look very promising.

IMO it's fine to forbid non-trusted providers initially (in other words,
all supported providers should be bundled with the JDK).

In the end, Vector API implementation should just call method handles
prepared by Foreign Linker API for native vector math routines from some
native library (SVML, SLEEF, or something else). It can be hidden behind
a service interface which returns a MethodHandle when requested
particular math operation of particular shape.

Best regards,
Vladimir Ivanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230106/d6490c1c/attachment-0001.htm>


More information about the panama-dev mailing list