[vectorIntrinsics] RFR: 8265312: Unsigned comparison operators
Jatin Bhateja
jbhateja at openjdk.java.net
Wed Apr 21 06:46:09 UTC 2021
On Fri, 16 Apr 2021 17:10:33 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> Add unsigned comparison operators to VectorOperators and add intrinsic support on x64.
src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 2143:
> 2141: vpmovzxbw(vtmp2, src2, vlen_enc);
> 2142: vpcmpCCW(dst, vtmp1, vtmp2, comparison, Assembler::W, vlen_enc, scratch);
> 2143: vpand(dst, dst, ExternalAddress(StubRoutines::x86::vector_short_to_byte_mask()), vlen_enc, scratch);
Hi @sviswa7 , zero extension for unsigned comparison for signed numbers looks fine, post extension comparison result will be all 1s or all 0s in corresponding lanes, by doing a signed saturation packing (vpacksswb) can we not avoid extra vector AND.
src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 2183:
> 2181: vpand(vtmp3, vtmp3, ExternalAddress(StubRoutines::x86::vector_short_to_byte_mask()), vlen_enc, scratch);
> 2182: vpackuswb(dst, dst, vtmp3, vlen_enc);
> 2183: vpermpd(dst, dst, 0xd8, vlen_enc);
since comparison is performed at lane level (x86 definition 128 bits) and later on we are packing the results of two lanes I am not sure about the need for last permute instruction.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/68
More information about the panama-dev
mailing list