On Tue, Sep 23, 2014 at 1:22 PM, Kirill Yukhin <kirill.yuk...@gmail.com> wrote:

> Patch in the bottom extends more shuffle patterns.
>
> Bootstrapped.
> AVX-512* tests on top of patch-set all pass
> under simulator.
>
> Is it ok for trunk?
>
> gcc/
>         * config/i386/i386.c
>         (ix86_expand_args_builtin): Handle CODE_FOR_sse2_shufpd,
>         CODE_FOR_sse2_sse2_shufpd_mask, 
> CODE_FOR_sse2_avx512dq_shuf_f64x2_mask,
>         CODE_FOR_sse2_avx512dq_shuf_i64x2_mask,
>         CODE_FOR_sse2_avx512vl_shuf_i32x4_mask and
>         CODE_FOR_sse2_avx512vl_shuf_f32x4_mask.
>         * config/i386/sse.md
>         (define_expand "avx512dq_shuf_<shuffletype>64x2_mask"): New.
>         (define_insn
>         "<mask_codefor>avx512dq_shuf_<shuffletype>64x2_1<mask_name>"): Ditto.
>         (define_expand "avx512vl_shuf_<shuffletype>32x4_mask"): Ditto.
>         (define_insn
>         "<mask_codefor>avx512vl_shuf_<shuffletype>32x4_1<mask_name>"): Ditto.
>         (define_expand "avx512vl_pshufdv3_mask"): Ditto.
>         (define_insn "avx2_pshufd_1<mask_name>"): Add masking.
>         (define_expand "avx512vl_pshufd_mask"): New.
>         (define_insn "sse2_pshufd_1<mask_name>"): Add masking.

OK with the small adjustment bellow.

Uros.

> -(define_insn "avx2_pshufd_1"
> -  [(set (match_operand:V8SI 0 "register_operand" "=x")
> +(define_insn "avx2_pshufd_1<mask_name>"
> +  [(set (match_operand:V8SI 0 "register_operand" "=v")
>         (vec_select:V8SI
> -         (match_operand:V8SI 1 "nonimmediate_operand" "xm")
> +         (match_operand:V8SI 1 "nonimmediate_operand" "vm")
>           (parallel [(match_operand 2 "const_0_to_3_operand")
>                      (match_operand 3 "const_0_to_3_operand")
>                      (match_operand 4 "const_0_to_3_operand")
> @@ -11589,7 +11714,8 @@
>     && INTVAL (operands[2]) + 4 == INTVAL (operands[6])
>     && INTVAL (operands[3]) + 4 == INTVAL (operands[7])
>     && INTVAL (operands[4]) + 4 == INTVAL (operands[8])
> -   && INTVAL (operands[5]) + 4 == INTVAL (operands[9])"
> +   && INTVAL (operands[5]) + 4 == INTVAL (operands[9])
> +   && <mask_avx512vl_condition>"

Put <mask_avx512vl_condition> check nearby TARGET_xxx in the target
selector to keep them together.

Uros.

Reply via email to