RFR: 8345766: C2 should emit macro nodes for ModF/ModD instead of calls during parsing [v2]
Theo Weidmann
tweidmann at openjdk.org
Thu Jan 9 10:05:36 UTC 2025
On Thu, 9 Jan 2025 09:59:29 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:
>> Why do you need the `static_cast<CallNode*>`? I mean why not use the common type `ModFloatingNode*`, which is a subtype of `CallNode*`, right?
>
>> Why you need the case for ModDNode?
>
> As @eme64 already explained this function is both for float and double. "floating point" here is supposed to mean both float and double.
>
>> Why not make it a BasicType bt instead of dbl, and then switch on that? Might be more readable than true / false.
> I read floating_point_mod(a, b, true), and am not sure what the true does.
>
> Good point. I will change it.
>
>> Why do you need the static_cast<CallNode*>? I mean why not use the common type ModFloatingNode*, which is a subtype of CallNode*, right?
>
> The cast is necessary because of the ternary operator but you are right that ModFloatingNode could be used as a more concrete subtype here. I will change it.
Actually the assignment further down from `as_Call` fails, so I'll leave it with CallNode.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22786#discussion_r1908477564
More information about the hotspot-compiler-dev
mailing list