RFR: 8349637: Integer.numberOfLeadingZeros outputs incorrectly in certain cases [v3]
Emanuel Peter
epeter at openjdk.org
Fri Feb 21 06:19:00 UTC 2025
On Thu, 20 Feb 2025 14:19:15 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> @rgiulietti Shifting by 1 instead of 24 is a really good idea, it makes showing the validity a lot more simple as you mention. I've applied the suggestion in the latest commit. The updated instruction sequence is also very interesting, I'd like to take a look at it in a followup RFE. I was planning on taking a closer look at the long intrinsic after this patch, since it doesn't use the floating point trick that int does and I was very curious to see what the performance would be like with it.
>>
>> @TobiHartmann I've pushed an adapted version of your test that checks for `numberOfLeadingZeros`/`numberOfTrailingZeros` correctness for int and long. Let me know what you think!
>
> @jaskarth Would it make sense to add this VectorAPI test as well?
> https://github.com/openjdk/jdk/pull/23579#issuecomment-2659586753
> @eme64 I think adding the Vector API test is a good idea. I added a new IR test to the file that exercises the logic with the vector api, and checked that it fails without the patch and passes with it. Let me know what you think!
@jaskarth That sounds good, thanks for adding it! I'm not going to review this, as there are already 3 doing that ;)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23579#issuecomment-2673570178
More information about the hotspot-compiler-dev
mailing list