JDK-8190872 : Regression in Math.pow for powers of 2
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • CPU: x86
  • Submitted: 2017-11-07
  • Updated: 2017-11-07
  • Resolved: 2017-11-07
Related Reports
Duplicate :  
Relates :  
Description
For Java 9 JDK-8145688 optimized Math.pow. This caused a regression compared to Java 8, which special cased for powers of 2. That special case is missing from Java 9.

See also:

https://www.reddit.com/r/javahelp/comments/7b5erh/i_think_i_found_piece_of_code_which_is_8_times/

Comments
Moving from hotspot/runtime -> hotspot/compiler since JDK-8145688 is also in hotspot/compiler. Update: [~psandoz] Did you mean to move this bug back to 'runtime' or was that a JBS glitch when you see the 'affects version' field? Update: Paul confirmed it was a JBS gltich.
07-11-2017

The attached JMH benchmark "Square" may be used for verification.
07-11-2017