RFR: 8261553: Efficient mask generation using BMI2 BZHI instruction

Claes Redestad redestad at openjdk.java.net
Thu Feb 11 10:30:38 UTC 2021


On Thu, 11 Feb 2021 08:31:40 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> BMI2 BHZI instruction can be used to optimize the instruction sequence
> used for mask generation at various place in array copy stubs and partial in-lining for small copy operations.

- Rather than removing the old code, I believe the code calling bzhiq needs to be in a branch checking `VM_Version::supports_bmi2`. Otherwise you'll hit asserts on older hardware without this extension
- Some demonstration of the performance benefit would be nice - either a new microbenchmark or a statistically significant result running some existing ones, e.g. `make test TEST=micro:ArrayCopy`

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

Changes requested by redestad (Reviewer).

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


More information about the hotspot-compiler-dev mailing list