x86 Intrinsics for fma in Math Library
Joseph D. Darcy
joe.darcy at oracle.com
Wed Jul 20 02:04:46 UTC 2016
The existing fma tests are far from exhaustive and would benefit from
being augmented by additional test cases, in particular some test cases
which exercise the harder rounding cases for a hardware implementation.
The changes to java.lang.Math look fine. I'm not a HotSpot developer so
can't comment on the particulars of the HotSpot code, but I have a few
general comments. For a intrinsic like this to be "performance correct"
the intrinsic should be used vs not-used consistently independent of
whether or not code is running in the interpreter, C1, or C2. From what
I can gather, this seems to be the case with your patch. (We've had
other math library functions which initially were not intrinsified under
the interpreter and were intrinsified, say, under an OSR in C2 and using
different implementations of a method could cause consistency issues.
That is less of a case here since the results of fma are exactly
specified, but it is still better to have a consistent performance model
for using fma.)
On 7/19/2016 9:38 AM, Deshpande, Vivek R wrote:
> Hi Dimitrij
> I used jdk/test/java/lang/Math/FusedMacTests.java for correctness
> added with this https://bugs.openjdk.java.net/browse/JDK-4851642
> *From:*dmitrij pochepko [mailto:dmitrij.pochepko at oracle.com]
> *Sent:* Saturday, July 16, 2016 1:14 PM
> *To:* Deshpande, Vivek R <vivek.r.deshpande at intel.com>; hotspot
> compiler <hotspot-compiler-dev at openjdk.java.net>
> *Cc:* vladimir.kozlov at oracle.com; Joseph D. Darcy <joe.darcy at oracle.com>
> *Subject:* Re: x86 Intrinsics for fma in Math Library
> What about at least simplest tests included like tests for other
> Intrinsics at hotspot/test/compiler/intrinsics/* ?
> On 14.07.2016 20:42, Deshpande, Vivek R wrote:
> I would like to contribute a patch for scalar x86 intrinsic
> support for fma operations in jdk9.1
> Could you please review the patch.
> We see significant performance gain over library implementation.
> Bug ID:
> hotspot changes:
> jdk changes:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev