[PATCH i386 AVX512] [52.1/n] Add vec2mask and mask2vec insn patterns.

Uros Bizjak ubizjak@gmail.com
Thu Sep 25 18:02:00 GMT 2014


On Thu, Sep 25, 2014 at 11:42 AM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Hello,
> As suggested, this is splitted out part of [52/n] patch,
> which introduces new vec2mask and mask2vec insn patterns.
>
> As suggested, I've got rid off use of UNSPEC_CVTINT2MASK
> unspec. Unfortunatelly, only partially.
> I suppose, that vec2mask generic RTX will be too complex:
> get most significant bit of each vec elt & compare it
> with zero setting destination mask register accordingly.
> If this approach is preferrable: I ready to do that.

No, we won't benefit anything from overly-complex patterns. Combine is
not _that_ smart.

> Testing in progress.
> Is it ok for trunk if pass?
>
> gcc/
>         * config/i386/predicates.md (define_predicate "constm1_operand"): New.
>         * config/i386/sse.md
>         (define_c_enum "unspec"): Add UNSPEC_CVTINT2MASK.
>         (define_insn "<avx512>_cvt<ssemodesuffix>2mask<VI12_AVX512VL:mode>"): New.
>         (define_insn "<avx512>_cvt<ssemodesuffix>2mask<VI48_AVX512VL:mode>"): Ditto.
>         (define_expand "<avx512>_cvtmask2<ssemodesuffix><VI12_AVX512VL:mode>"): Ditto.
>         (define_insn "*<avx512>_cvtmask2<ssemodesuffix><VI12_AVX512VL:mode>"): Ditto.
>         (define_expand "<avx512>_cvtmask2<ssemodesuffix><VI48_AVX512VL:mode>"): Ditto.
>         (define_insn "*<avx512>_cvtmask2<ssemodesuffix><VI48_AVX512VL:mode>"): Ditto.

Looks reasonable.

Updated patch is OK for mainline.

Thanks,
Uros.



More information about the Gcc-patches mailing list