RFR: 8318509: x86 count_positives intrinsic broken for -XX:AVX3Threshold=0 [v2]

Claes Redestad redestad at openjdk.org
Mon Oct 23 19:22:52 UTC 2023


> The AVX-512 implementation of count_positives is broken when there are negative values in the tail block, since the len register is repurposed to then re-read as-if it still contained the original value. 
> 
> Proposed fix is to restore len from the value in tmp1, which at this point holds the count of bytes in the tail. 
> 
> Existing TestCountPositives test is pretty exhaustive and just needs to be run explicitly with AVX3Threshold=0 enabled.

Claes Redestad has updated the pull request incrementally with two additional commits since the last revision:

 - Remove redundant 0 + tail
 - Randomize array segment sizes and the amount of negatives. Add some tests that limit negatives to a tail.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16267/files
  - new: https://git.openjdk.org/jdk/pull/16267/files/0c6b56b0..290d01d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16267&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16267&range=00-01

  Stats: 162 lines in 2 files changed: 78 ins; 39 del; 45 mod
  Patch: https://git.openjdk.org/jdk/pull/16267.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16267/head:pull/16267

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


More information about the hotspot-compiler-dev mailing list