RFR: 8320715: Improve the tests of test/hotspot/jtreg/compiler/intrinsics/float16

Vladimir Kozlov kvn at openjdk.org
Tue Nov 28 17:00:06 UTC 2023


On Sun, 26 Nov 2023 10:48:44 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Hi,
> Can you review the patch to improve the tests of test/hotspot/jtreg/compiler/intrinsics/float16?
> Thanks.
> 
> Currently, there are several areas where improvements can be made:
> 1. test should not exit early before all test cases have run.
> 2. some output hide the data details, which should be printed out to help debug any potential issues, e.g. currently it could output some log like below in case of wrong implementation of a ConvF2HF intrinsic:
> `Inconsistent result for Float.floatToFloat16(NaN/ff802000): fc01 != fc01`, which is rather confusing, not helpful. Suggested output would be: `Inconsistent result for Float.floatToFloat16(NaN/ff802000): fc01(64513) != fc01(-1023)`

Good improvement. I have comment.

test/hotspot/jtreg/compiler/intrinsics/float16/Binary16Conversion.java line 335:

> 333:                 errors++;
> 334:                 System.out.println("Different conversion of float value 1 (" + f + "/" + Integer.toHexString(Float.floatToRawIntBits(f)) + "): " +
> 335:                                     Integer.toHexString(s1 & 0xffff) + "(" + s1 + ")" + " != " + Integer.toHexString(s2 & 0xffff) + "(" + s2 + ")");

May be split this long line as you did in previous case.
Why you want `1` in `value 1`?

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

PR Review: https://git.openjdk.org/jdk/pull/16815#pullrequestreview-1753410956
PR Review Comment: https://git.openjdk.org/jdk/pull/16815#discussion_r1408086809


More information about the hotspot-compiler-dev mailing list