RFR: 8350896: Integer/Long.compress gets wrong type from CompressBitsNode::Value [v2]

Jatin Bhateja jbhateja at openjdk.org
Wed Apr 2 07:39:04 UTC 2025


On Wed, 12 Mar 2025 08:08:19 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/intrinsicnode.cpp line 283:
>> 
>>> 281:         clz = bt == T_INT ? clz - 32 : clz;
>>> 282:         mask_max_bw = max_bw - clz;
>>> 283:       }
>> 
>> Can you please put the comments for cases 1-3 either consistently before the condition, or after the condition with inlining? I would vote for inside each condition with indentation, so just like case 3), except 2 spaces indented ;)
>
> Why not start with the "nice" case 3) first, where we know that the range is positive, and so even after compression we cannot get negative values?
> 
> What does this mean `only includes +ve values`?

Case ordering is in accordance with the mask value range.
case 1) mask value spans across -ve and -ve value ranges.
case 2) mask value strictly lie within -ve value range. 
case 3) mask value strictly lie within +ve value range.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23947#discussion_r2024244581


More information about the hotspot-compiler-dev mailing list