RFR: 8269725: AArch64: Add VectorMask query implementation for NEON [v2]

Xiaohong Gong xgong at openjdk.java.net
Thu Jul 8 09:38:52 UTC 2021


On Thu, 8 Jul 2021 09:28:02 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
>> 
>>  - Merge branch 'jdk:master' into JDK-8269725
>>  - 8269725: AArch64: Add VectorMask query implementation for NEON
>
> src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 line 2299:
> 
>> 2297:   ins_encode %{
>> 2298:     // Revert the bits and count the leading zero bytes.
>> 2299:     __ negr(as_FloatRegister($tmp$$reg), __ T8B, as_FloatRegister($src$$reg));
> 
> Should that be "Reverse the bits?" But in any case, we can see that the code calls rbit then clz, presumably because you want to count the trailing bits. What does the negr do here?

Thanks for your comment @theRealAph !  Yeah, it's "Reverse the bits".  Thanks for pointing out this!
`negr` is used to convert the original mask values from `0/1` to `0/-1`. So that we can firstly calculate the trailing zero numbers in bits, and then divide it by 8. Note that the mask input for these operations are different from others. It is actually a boolean vector with `0/1` as the element value.

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

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


More information about the hotspot-compiler-dev mailing list