RFR: 8370196: C2: Improve (U)MulHiLNode::MulHiValue [v5]
Zihao Lin
duke at openjdk.org
Sat Nov 22 14:51:49 UTC 2025
On Fri, 21 Nov 2025 07:02:58 GMT, Hannes Greule <hgreule at openjdk.org> wrote:
>> I think TypeLong::make is doing the work your mentioned, do we need another function to do it?
>>
>>
>> const TypeLong* TypeLong::make(jlong con) {
>> julong ucon = con;
>> return (new TypeLong(TypeIntPrototype<jlong, julong>{{con, con}, {ucon, ucon}, {~ucon, ucon}},
>> WidenMin, false))->hashcons()->is_long();
>> }
>
> Sorry if it wasn't clear, but the problem is that `multiply_high_unsigned` returns an *unsigned* long which you currently convert into a *signed* long. But from my understanding this is implementation-defined and I *think* you need to avoid that (I might be wrong though, happy to be corrected by someone else here :) ). That would mean you need to make `highResult` a `julong` and then you can't use `TypeLong::make` anymore as this would result in the same problem again.
Understood, I add `TypeLong::make_unsigned` to solve it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28097#discussion_r2553171552
More information about the hotspot-compiler-dev
mailing list