RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v53]

Emanuel Peter epeter at openjdk.org
Thu May 1 07:27:00 UTC 2025


On Thu, 1 May 2025 07:21:54 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - wording
>>  - grammar, more details for non-existence
>
> src/hotspot/share/opto/rangeinference.cpp line 263:
> 
>> 261:     // is a 0 that should be a 1. Obviously, since the bit at that position in
>> 262:     // ones is 1, the same bit in zeros is 0. Which means this is the value of
>> 263:     // i we are looking for.
> 
> Suggestion:
> 
>     // This means that the first bit that does not satisfy the bit requirement
>     // is a 0 that should be a 1. Obviously, since the bit at that position in
>     // ones is 1, the same bit in zeros is 0. Which means this is the value of
>     // we are looking for.
>     // We know i is the largest bit index such that:
>     // - lo[x] satisfies bits for 0 <= x < i (2.2)
>     // - zeros[i] = 0                        (2.3)
>     // - lo[i]    = 0                        (2.4)
>     // For the given i, we know that lo satisfies all bits before i, hence (2.2)
>     // holds. Further, lo[i] = 0 (2.3), and we have a one violation at i, hence
>     // zero[i] = 0 (2.4). Any smaller i would not be the largest possible such
>     // index. Any larger i would violate (2.2), since lo[i] does not satisfy bits.
> 
> I just realized that we should explicitly tie this back in to the proof we wrote above, and link it to the numbers there.

Now below, we should try to tie the construction back to (2.5 - 2.7), let me give it a try.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2069930283


More information about the hotspot-compiler-dev mailing list