RFR: 8265917: Different values computed by C2 and interpreter/C1 for Math.pow(x, 2.0) on x86_32
jiefu at openjdk.java.net
Mon Apr 26 06:20:33 UTC 2021
On Sun, 25 Apr 2021 18:09:01 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> I think you should fix 32-bit version of `dpow` stub because 64-bit stub has this optimization:
> Also add `pow(x, 0.5)` as well.
> C `dpow` code in VM has this optimization which works in 32- and in 64-bit when stub is not used (for example, on other platforms):
> Java lib code also has this optimization:
> Only 32-bit x86 stub is missing it:
> The stub is generated only on x86:
> $ grep -r StubRoutines::_dpow src/hotspot/cpu/
> src/hotspot/cpu//x86/stubGenerator_x86_64.cpp: StubRoutines::_dpow = generate_libmPow();
> src/hotspot/cpu//x86/stubGenerator_x86_32.cpp: StubRoutines::_dpow = generate_libmPow();
> I suggest to fix it to be consistent with the rest of VM and Java lib code.
Hi @vnkozlov ,
Math.pow(x, 2.0) has been optimized for x86_32.
As for the Math.pow(x, 0.5), it will be handled in JDK-8265940 after this issue.
More information about the hotspot-compiler-dev