RFR: 8325438: Add exhaustive tests for Math.round intrinsics [v8]

Hamlin Li mli at openjdk.org
Wed Mar 20 19:11:34 UTC 2024


On Wed, 20 Mar 2024 13:03:48 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> > For inf, the probability is 2 in all runs (+inf, -inf); for NaN, the probability is (eStep/eBound) (but depends on rand value), in new version I modify it to make sure it tests NaN, so it's (eStep/eBound) now.
> > Just my experience, for Math.round(float/double), special cases like inf/NaN are not the error-prone ones, normal values are more error-prone.
> 
> Maybe it is not super error-prone, but you never know. I've seen multiple bugs with other float-operations, so now it always makes me nervous when I don't see them.
> 
> Can you please throw in these special cases explicitly, so we can be sure we have them? I think that the significand/exponent combination works now, but I'm always a bit scared that we still have an error, and we don't see it. That is why I think it would be nice to have at least one very clean random number that is thrown it as well, that has no modifications to it.

Sure, I added some special case explicitly.

> 
> But your generation method clearly has advantages: we systematically cover all ranges. That is good.
> 
>
> Thanks for the work :)

Thanks for the detailed review :)

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

PR Comment: https://git.openjdk.org/jdk/pull/17753#issuecomment-2010403870


More information about the hotspot-compiler-dev mailing list