RFR: 8342103: C2 compiler support for Float16 type and associated scalar operations [v3]

Emanuel Peter epeter at openjdk.org
Tue Dec 17 07:50:04 UTC 2024


On Tue, 17 Dec 2024 07:16:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adding more test points
>
> src/hotspot/share/opto/convertnode.cpp line 960:
> 
>> 958:   }
>> 959:   return TypeInt::SHORT;
>> 960: }
> 
> Do we have tests for these constant folding operations?

We would need all sorts of conversion with Float16 <-> short. With Float16 constant and variable values. And also with short constant and variable values.

> src/hotspot/share/opto/divnode.cpp line 826:
> 
>> 824:       t2->getf() != 0.0)  {
>> 825:     // could be negative zero
>> 826:     return TypeH::make(t1->getf()/t2->getf());
> 
> Suggestion:
> 
>     return TypeH::make(t1->getf() / t2->getf());

Are we sure that the rounding behaviour of float is the correct behaviour for Float16? I would like to see some examples where rounding matters.

> src/hotspot/share/opto/type.cpp line 1465:
> 
>> 1463: //------------------------------meet-------------------------------------------
>> 1464: // Compute the MEET of two types.  It returns a new Type object.
>> 1465: const Type *TypeH::xmeet( const Type *t ) const {
> 
> Please write `TypeH*` and not `TypeH *`

Do that everywhere in the code that you touch, except it breaks strongly with immediately surrounding code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22754#discussion_r1888015077
PR Review Comment: https://git.openjdk.org/jdk/pull/22754#discussion_r1888033031
PR Review Comment: https://git.openjdk.org/jdk/pull/22754#discussion_r1888018364


More information about the hotspot-compiler-dev mailing list