RFR: 8345766: C2 should emit macro nodes for ModF/ModD instead of calls during parsing [v6]

Vladimir Kozlov kvn at openjdk.org
Thu Jan 9 17:00:41 UTC 2025


On Thu, 9 Jan 2025 10:02:59 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:

>>> 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.

I have typo in my original question. What I meant to ask is: why you have cast only for ModDNode and not for ModFNode?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22786#discussion_r1909165263


More information about the hotspot-compiler-dev mailing list