RFR: 8265325: Optimize StubRoutines::dpow() for Math.pow(x, 0.5) [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Fri Apr 16 23:41:36 UTC 2021
On Fri, 16 Apr 2021 23:07:20 GMT, Jie Fu <jiefu at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/intrinsics/math/TestPow0Dot5Opt.java line 41:
>>
>>> 39: if (a < 0.0) return;
>>> 40:
>>> 41: double r1 = Math.sqrt(a);
>>
>> `r1` should be static value to avoid compiling `sqrt()` method as intrinsic.
>
>> `r1` should be static value to avoid compiling `sqrt()` method as intrinsic.
>
> Hi @vnkozlov ,
>
> Thanks for your review.
>
> Patch has been updated based on your comments.
>
> To be honest, I didn't get why r1 should be static value.
> I think both static and non-static should be OK for the test.
>
> So what would happen is sqrt() is intrinsified?
> Could you please make it more clearer?
>
> Thanks.
> Best regards,
> Jie
Sorry, my bad. I thought to calculate `sqrt(a)` outside `test` method so that only `pow()` code is tested.
Like calculating `gold` value not in compiled code.
But the test have to use sqrt() for each value `a` and `sqrt` is 1 HW instruction so my suggestion was stupid.
Please, revert this change. Original test code was fine.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3536
More information about the hotspot-compiler-dev
mailing list