RFR: 8349637: Integer.numberOfLeadingZeros outputs incorrectly in certain cases [v3]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Fri Feb 14 15:29:13 UTC 2025


On Thu, 13 Feb 2025 16:38:09 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> Shouln't L.6230 read as follows?
> 
> ```
>   // LZCNT = 31 - (biased_exp - 127)
> ```

@rgiulietti I believe you are correct, the comment there is wrong. I think it is a typo, it might be because the intrinsic logic computes `LZCNT = 32 - ((biased_exp - 127) + 1)` which is equivalent. I'll update the comments to make this more clear.

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

PR Comment: https://git.openjdk.org/jdk/pull/23579#issuecomment-2659616333


More information about the hotspot-compiler-dev mailing list