RFR: 8325438: Add exhaustive tests for Math.round intrinsics [v9]
Hamlin Li
mli at openjdk.org
Thu Apr 4 09:59:02 UTC 2024
On Thu, 4 Apr 2024 09:18:50 GMT, Andrew Haley <aph at openjdk.org> wrote:
> There's no need for randomness or arrays or special values in the 32-bit case. You can, and should, test the entire 32-bit range in a few lines of code by using floatBitsToInt.
In previous discussion, there are several reasons why it's implemented in this way:
1. test the whole range of 32 bits is slow, and even slow for a 64 ranges double.
2. if it's too slow, then it's not feasible to make it an automatic test.
these are expected by @eme64.
> You can make the test much faster by copy-and-pasting the library code for Math.round(float) and letting the JIT compile it.
Previously, I had [this question](https://github.com/openjdk/jdk/pull/17753#issuecomment-1992519401), but from the point view of correctness of the golden value.
I think you make another point to change from @DontCompile to copying library java code. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17753#discussion_r1551367964
More information about the hotspot-compiler-dev
mailing list