Integrated: 8367391: Loss of precision on implicit conversion in vectornode.cpp

erifan duke at openjdk.org
Wed Sep 24 01:38:25 UTC 2025


On Tue, 23 Sep 2025 10:03:09 GMT, erifan <duke at openjdk.org> wrote:

> There is an issue with fix against JDK-8356760 on windows-x64 related to following lines
> 
>   long mask = (-1ULL >> (64 - vlen));
>   long bit  = type->get_con() & mask;
> 
> 
> `-1ULL` is an unsigned **64-bit** value; on Linux/macOS-x64, `long` is **64** bits, but on Windows-x64 it’s **32** bits. When assigning `-1ULL >> (64 - vlen)` to a `long` on Windows-x64, the **64-bit** result is truncated to **32** bits, causing precision loss as the upper 32 bits are discarded.
> 
> This pull request addresses the issue by replacing the `long` type with `jlong`. The fix has been verified on a Windows x64 machine with avx-512 support and resolves the reported problem.

This pull request has now been integrated.

Changeset: 528f93f8
Author:    erifan <erfang at nvidia.com>
Committer: Xiaohong Gong <xgong at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/528f93f8cb9f1fb9c19f31ab80c8a546f47beed2
Stats:     33 lines in 2 files changed: 6 ins; 0 del; 27 mod

8367391: Loss of precision on implicit conversion in vectornode.cpp

Reviewed-by: chagedorn, roland

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

PR: https://git.openjdk.org/jdk/pull/27449


More information about the hotspot-compiler-dev mailing list