JDK-8303161 : [vectorapi] VectorMask.cast narrow operation returns incorrect value with SVE
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20,21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2023-02-24
  • Updated: 2023-04-17
  • Resolved: 2023-03-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b16Fixed
Related Reports
Relates :  
Description
The cast operation for VectorMask from wider type to narrow type returns incorrect result for the trueCount() (and on some SVE machines toLong() as well) of the resultant mask vector on SVE machines. It is because the higher order bits are not cleared (since the result is narrowed down) and trueCount() counts the number of true values in the higher order bits as well, returning incorrect result.
Comments
Changeset: 67274906 Author: Bhavana Kilambi <bkilambi@openjdk.org> Committer: Nick Gasson <ngasson@openjdk.org> Date: 2023-03-29 16:12:56 +0000 URL: https://git.openjdk.org/jdk/commit/67274906aeb7a6b83761e6aaf85688aa61aa8a20
29-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12901 Date: 2023-03-07 10:56:40 +0000
07-03-2023

Great, thanks for confirming.
27-02-2023

Hi yes, apologies I missed assigning it to me. I am working on it.
27-02-2023

[~bkilambi] do you plan to work on this?
27-02-2023

ILW = Incorrect result with compiled code, VectorMask.cast on SVE/SVE2, disable compilation/intrinsic = HLM = P3
27-02-2023