RFR: 8279282: [vectorapi] Matcher::supports_vector_comparison_unsigned is not needed on x86 [v3]

Sandhya Viswanathan sviswanathan at openjdk.java.net
Tue Jan 18 17:52:36 UTC 2022


On Sun, 16 Jan 2022 08:04:31 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

>> src/hotspot/cpu/x86/macroAssembler_x86.cpp line 3254:
>> 
>>> 3252:     vpcmpCC(dst, nds, src, eq_cond_enc, width, vector_len);
>>> 3253:     vallones(xtmp, vector_len);
>>> 3254:     vpxor(dst, xtmp, dst, vector_len);
>> 
>> This would add extra overhead of doing vallones every time versus what we had before.
>
> Thanks a lot for the review.
> uiCA shows that both result in 3 uops being executed if the all ones is reachable. If the external address is not reachable however, an extra `mov` instruction would need to be emitted in the current approach, leading to 1 extra uop.
> Trying `_mm256_xor_si256(src, _mm256_set1_epi32(-1))` it seems that both gcc and clang use `vcmpeqd`.

@merykitty Thanks for the explanation.

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

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


More information about the hotspot-dev mailing list