RFR: 8352585: Add special case handling for Float16.max/min x86 backend [v6]
Jatin Bhateja
jbhateja at openjdk.org
Tue Apr 1 16:17:22 UTC 2025
On Fri, 28 Mar 2025 22:14:23 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:
>> Basically assert if one is NaN and other is not.
>
> On further thought what you have also works. Though we could simplify the assertionCheck method to just one statement:
> public static boolean assertionCheck(Float16 actual, Float16 expected) {
> return !actual.equals(expected);
> }
> This is because, the equals method takes care of NaNs. The [equals](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Double.html#equals(java.lang.Object)) uses [representation equivalence](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Double.html#repEquivalence), defining NaN arguments to be equal to each other.
DONE
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24169#discussion_r2023172099
More information about the hotspot-compiler-dev
mailing list