RFR: 8353266: C2: Wrong execution with Integer.bitCount(int) intrinsic on AArch64 [v2]

Marc Chevalier mchevalier at openjdk.org
Mon Jun 2 10:37:12 UTC 2025


On Sat, 31 May 2025 14:29:26 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions
>
> src/hotspot/cpu/aarch64/aarch64.ad line 7771:
> 
>> 7769:   ins_encode %{
>> 7770:     __ mov($tmp$$FloatRegister, __ S, 1, zr);             // tmp[32:63] <- 0
>> 7771:     __ mov($tmp$$FloatRegister, __ S, 0, $src$$Register); // tmp[ 0:31] <- src
> 
> "Where the entire 128-bit wide register is not fully utilized, the vector or scalar quantity is held in the least significant bits of the register, with the most significant bits being cleared to zero on a write."
> 
> Suggestion:
> 
>     __ fmovs($tmp$$FloatRegister, $src$$Register);
> 
> should do it.

Yes! Nicer, thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25551#discussion_r2120723694


More information about the hotspot-compiler-dev mailing list