RFR: 8281544: assert(VM_Version::supports_avx512bw()) failed for Tests jdk/incubator/vector/

Emanuel Peter duke at openjdk.java.net
Thu Feb 17 08:00:28 UTC 2022


`ZSaveLiveRegisters::ZSaveLiveRegisters` stores live registers, and later they are loaded again.
This includes opmask registers, which are part of AVX512. However, not all platforms have all of the AVX512 instructions.
For example Knights Landing has general AVX512 support and makes use of optmask registers, but does not support the AVX512 BW subset of instructions, specifically it does not support the `kmovql` instruction. Platforms like Cannon Landing have support for AVX512 BW.

Solution: in analogy to `RegisterSaver::save_live_registers`, which seems to perform a very similar task, use `MacroAssembler::kmov` instead of `kmovql` directly. Internally, `kmov` choses either `kmovql` if avx512bw is available, else it takes `kmovwl`.

As a regression test, I took one of the tests that failed with `-XX:+UnlockExperimentalVMOptions -XX:+UseZGC`, and added an additional `@run` statement with those flags. I simulated this test locally with `sde -knl` (Knights Landing, AVX512 but not BW, fails without change to `kmov`, passes with it) and `sde -cnl` (Cannon Landing, has AVX512 BW, passes before and after code change). Ran additional tests to verify that the test triggers before code change, and that with the code change nothing broke.

@neliasso Thanks for the help!

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

Commit messages:
 - 8281544: assert(VM_Version::supports_avx512bw()) failed for Tests jdk/incubator/vector/

Changes: https://git.openjdk.java.net/jdk/pull/7510/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7510&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281544
  Stats: 14 lines in 2 files changed: 12 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7510.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7510/head:pull/7510

PR: https://git.openjdk.java.net/jdk/pull/7510


More information about the hotspot-dev mailing list