JDK-8170693 : Interpreter and JIT compilers should always use the same code for math intrinsics
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2016-12-03
  • Updated: 2020-05-07
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Similar to JDK-8170430 code generated by JIT compilers may produce different results depending on flags setting which controls math intrinsics generation and usage. It includes but does not limit to next XX flags:
   InlineIntrinsics
   DisableIntrinsic
   UseMathExactIntrinsics
   UseLibmIntrinsic

And other different platform specific intrinsics.

Depending on flags settings next code could be used:
C code from JVM SharedRuntime,
pre-generated code from StubRoutines,
bytecode execution (in case of java implementation presence),
JNI call to native implementation.

Currently Interpreter and JIT compilers use different code which selects what to call:

Interpreter: TemplateInterpreterGenerator::generate_math_entry
C1: LIRGenerator::do_MathIntrinsic
C2: LibraryCallKit::inline_math_native

We should have one place which select what should be used by Interpreter and JIT compilers.
Comments
The most problems in the past we had with pow() intrinsic. There was several problems when we switched from C-code to use x87: JDK-7133857.
21-02-2017

ILW = Inconsistent results with math intrinsics, no reported issues, disable math intrinsics = HLL = P4
20-02-2017

Hi Vladimir, I'm assigning this issue to you so that we take care of it. If you want, I can also track it (in that case just please assign it to me). Best regards, Zoltan
15-12-2016

I am targeting JDK 10 because (lucky ?) ther are no reported issues.
03-12-2016