JDK-8190869 : C2: missing strength reduction of Math.pow(x, 2.0D) to x*x
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-07
  • Updated: 2019-09-13
  • Resolved: 2017-12-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 11
10 b37Fixed 11Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
There's a performance regression in 9 (compared to 8) in Math.pow(x, 2.0D). 

Math.pow() was rewritten in 9 (see JDK-8145688), but it doesn't have special case for power-of-two in C2 intrinsic implementation. 

Original report:
https://www.reddit.com/r/java/comments/7bbh72/i_think_i_found_piece_of_code_which_is_8_times/
Comments
ILW = performance regression; for Math.pow(x, 2.0D) case for x86, no fast path for power-of-two in C2 intrinsic; no workaround = MMH = P3
10-11-2017

A similar issue was fixed in 8 (JDK-8029302).
07-11-2017