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:02:35 UTC 2025
On Wed, 8 Jan 2025 08:20:50 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> He has a call from `Bytecodes::_frem:` and from `Bytecodes::_drem:`.
>>
>> 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.
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22786#discussion_r1908472641
More information about the hotspot-compiler-dev
mailing list