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

Jatin Bhateja jbhateja at openjdk.org
Mon Nov 25 20:04:13 UTC 2024


On Mon, 25 Nov 2024 07:18:41 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/connode.cpp line 49:
>> 
>>> 47:   switch( t->basic_type() ) {
>>> 48:   case T_INT:         return new ConINode( t->is_int() );
>>> 49:   case T_SHORT:       return new ConHNode( t->is_half_float_constant() );
>> 
>> That will be quite confusing.... don't you think?
>
> I mean do we need this? We already have `ConHNode::make` below...?

JVM treats, byte and short as constrained integer type, which is why we create ConI and not ConB or ConS.
In addition, transform routines of PhaseGVN and PhaseIterGVN use ConNode::make interface to create a constant IR node, it will not be appropriate to add a specialization over there. I have modified the check to remove unnecessary ambiguity while still maintaining the constant creation interface.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21490#discussion_r1857268078


More information about the core-libs-dev mailing list