On Wed, 22 Jun 2022 12:43:53 GMT, Quan Anh Mai <d...@openjdk.org> wrote:

> Improve the implementation of `Double/Float.isInfinite` to reduce branching. 
> Using `>` comparison with `MAX_VALUE` instead of `==` with 
> `POSITIVE_INFINITY` improves code emission on x86 and produces similar code 
> for arm. This is also the way gcc implements `std::isinf` on x86 and arm 
> (clang uses the pattern `Math.abs(v) == POSITIVE_INFINITY` on arm).
> 
> `test/micro/org/openjdk/bench/java/lang/FPComparison.java` has been added in 
> #8525, the results are reshown here:
> 
>     Benchmark                      Mode  Cnt     Score     Error    Score     
> Error   Unit   Ratio
>     FPComparison.isInfiniteDouble  avgt    5  1232.800 ±  31.677  621.185 ±  
> 11.935  ns/op    1.98
>     FPComparison.isInfiniteFloat   avgt    5  1234.708 ±  70.239  623.566 ±  
> 15.206  ns/op    1.98
> 
> Thank you very much.

May I have a review for this patch, please? Thanks a lot.

-------------

PR: https://git.openjdk.org/jdk/pull/9238

Reply via email to