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

erifan duke at openjdk.org
Tue Sep 23 10:10:49 UTC 2025


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.

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

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

Changes: https://git.openjdk.org/jdk/pull/27449/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27449&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8367391
  Stats: 33 lines in 2 files changed: 6 ins; 0 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/27449.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27449/head:pull/27449

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


More information about the hotspot-compiler-dev mailing list