8265917: Different values computed by C2 and interpreter/C1 for Math.pow(x, 2.0) on x86_32 #3677
C2 may produce different results for Math.pow(x, 2.0) compared with interpreter/C1 on x86_32.
E.g., for Math.pow(1.0 / 2047, 2.0):
The reason is that C2 will replace Math.pow(x, 2.0) with x*x.
The fix just disables C2's opt for Math.pow(x, 2.0) on x86_32 since nobody (or very few people) would run x86_32.
Another reason to fix this bug is that we need this patch to extend C2's opt for Math.pow(x, 0.5) on other platforms.
The text was updated successfully, but these errors were encountered:
I think you should fix 32-bit version of
Java lib code also has this optimization:
Only 32-bit x86 stub is missing it:
The stub is generated only on x86:
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.
@DamonFool This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
At the time when this comment was updated there had been 58 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
@DamonFool Since your change was applied there have been 58 commits pushed to the
Your commit was automatically rebased without conflicts.
Pushed as commit 889d246.