RFR: 8370922: Template Framework Library: Float16 type and operations
Emanuel Peter
epeter at openjdk.org
Mon Dec 15 06:49:56 UTC 2025
On Fri, 12 Dec 2025 17:34:35 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:
>> We should test `Float16` with Template Framework Tests. For this, I'm now implementing:
>>
>> - Template Framework Library: add `Float16Type` that represents `Float16`. Extend `Operations.java` with `Float16` operations.
>> - `Verify.java`: add verification for `Float16`, and corresponding tests in `TestVerifyIncubatorVector.java`. We could have done this separately, but it is not much code and completes the pipeline from code generation through execution and finally result verification in the following two tests.
>> - Adding `Float16` to `ExpressionFuzzer.java` and `TestExpressions.java`.
>
> test/hotspot/jtreg/compiler/igvn/ExpressionFuzzer.java line 343:
>
>> 341: // Generate expressions with any scalar numeric types.
>> 342: for (CodeGenerationDataNameType type : SCALAR_NUMERIC_TYPES) {
>> 343: for (int i = 0; i < 2; i++) {
>
> What does this loop do? And why do we have only 2 iterations here, but 10 for `PRIMITIVE_TYPES`?
It `Generate[s] expressions with any scalar numeric types.` ;)
The question is just how many per (output) type. Here we do 2 for each type.
The 2 vs 10 is quite arbitrary. I did not want to increase the runtime of the test too much. For now, focusing more on the primitive types an operations is probably good, Float16 is still rather niche. But we can change the balance in the future.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28095#discussion_r2618176244
More information about the hotspot-compiler-dev
mailing list