[vector api] Operations on Mask-s
Ningsheng Jian (Arm Technology China)
Ningsheng.Jian at arm.com
Fri Jan 4 01:57:42 UTC 2019
Hi,
> -----Original Message-----
> From: panama-dev <panama-dev-bounces at openjdk.java.net> On Behalf Of
> Vladimir Ivanov
> Sent: Friday, January 4, 2019 9:02 AM
> To: Tomasz Kowalczewski <tomasz.kowalczewski at gmail.com>; panama-
> dev at openjdk.java.net
> Subject: Re: [vector api] Operations on Mask-s
>
> Tomasz,
>
> Yes, I had similar experience with complex use cases involving masks.
> The API works well for lane-wise cases, but falls apart when cross-lane
> operations are needed, requiring user to go through intermediate
> representations which aren't optimized well.
>
> There are different ways to fix that gap on API level, e.g.:
> * declare more operations on Mask
> * operate on long: Mask <=> long
> * operate on Vector: Mask <=> Vector or Mask <: BoolVector <: Vector
>
> But IMO the main limiting factor to proceed is implementation considerations.
>
> On x86 there are 2 ways to represent masks: (1) as high bits in vector registers
> (pre-AVX512) and (2) as opmask registers (k0-k7). (I believe it's similar on ARM
> with NEON and SVE.)
>
Yes, and since SVE has fully predicate (mask) support, we would like to implement it in the mask register way, but need to keep compatible with non-mask Arches.
> C2 doesn't have full AVX512 support yet (e.g., no opmask register support in
> register allocator) and it was decided to focus on pre-AVX512 model first. So,
> current implementation represents masks as vectors uniformly across pre-
> AVX512 and AVX512-capable CPUs. And that's probably the main reason why
> Mask hasn't got enough attention yet.
>
Do you (or anyone else) have any plan to work on opmask register support in register allocator?
Thanks,
Ningsheng
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
More information about the panama-dev
mailing list