[aarch64-port-dev ] RFR(S): 8210461 - AArch64: Math.cos intrinsic gives incorrect results

Dmitrij Pochepko dmitrij.pochepko at bell-sw.com
Fri Sep 7 16:45:36 UTC 2018


Hi Andrew,

Ok. I'm really sorry to have introduced such a bug and I agree that the 
best strategy is to disable the intrinsic temporarily for sin and cos.

I aim to work with Andrew Dinn on pow to calibrate and enhance 
documentation and algorithm there first. Then I'll get back to sin/cos 
and revise it in a same manner.

Meanwhile, do we have to abandon this particular patch? It still resolve 
this particular problem and it would be a waste to re-debug and fix this 
problem later.

Thanks,
Dmitrij


On 07/09/18 18:26, Andrew Haley wrote:
> On 09/07/2018 03:03 PM, Dmitrij Pochepko wrote:
>> I remember debugging this branch while running JCK tests.
>>
>> Haven't checked precisely, but probably fw was  0 on those cases, so, z
>> - two24B*fw and z + tmp24B*fw. It would explain such behavior.
> I see.
>
> I wrote some simple code to stress test argument reduction, and it
> immediately failed.  The range reduction code is so horribly
> complicated that the *first thing* to have done should have been to
> stress test it, and evidently that was not done.
>
> The code, as it stands, is so complicated and tangled that it is
> almost impossible for anybody to debug and analyse. Its documentation
> is inadequate, for the same reasons that Andrew Dinn explained with
> respect to pow(). I can't have any confidence that there aren't more
> lurking bugs, and this method is too important to risk breakage. It
> needs some major reworking. In hindsight, I should not have accepted
> it.
>
> It's too late to get this fixed in the JDK 11 release, so it's going
> to go out broken on AArch64. I'll disable the intrinsic in JDK devel
> and tell the distro packagers to do patch their packages. Then we can
> rewrite this intrinsic with a view of fixing its maintainability and
> documentation, and perhaps including it in JDK 12.
>



More information about the hotspot-compiler-dev mailing list