JDK-8210461 : AArch64: Math.cos intrinsic gives incorrect results
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • CPU: aarch64
  • Submitted: 2018-09-06
  • Updated: 2019-01-18
  • Resolved: 2018-09-14
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 12
12 b12Fixed
Related Reports
Relates :  
Description
Range reduction for trig functions on AArch64 is broken. The smallest case is

Math.cos(1647100)
which should return 0.7833030468809974 but returns -0.2745634094819721.

The problem is that  __kernel_rem_pio2 is supposed to reduce its argument to the range [-pi/4, pi/4], pi/4 ~ 0.785398164 but it does not: it returns 1.8489319595787654, which is outside the range of the polynomial cosine approximation.
Comments
Thank you Dmitrij.
18-01-2019

Verified
18-01-2019

[~mseledtsov] I updated my gcc to a newer one and later revisions compiled successfully. Compiled revision 53161:4003935e6e5f and verified this fix.
18-01-2019

[~dpochepk] Yes, the jdk-12+27 can be used for verification.
17-01-2019

[~mseledtsov] Do I need to use some specific revision for verification? current last revision (53161:4003935e6e5f)in jdk/jdk12 is not compilable. As well as last tagged revision (jdk-12+28). Seem like I can compile a week-old jdk-12+27.
17-01-2019

[~dpochepk] Hi Dmitry. Could you, please, verify this bug? We are verifying all P1 and P2 bugs for JDK 12. Since we do not have access to your platform/environment, could you please verify this bug? If you have any questions please let me know.
16-01-2019