On Thu, Oct 09, 2014 at 04:13:25PM +0400, Kirill Yukhin wrote:
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -39791,6 +39791,8 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum
> machine_mode mode,
> case V8SFmode:
> case V8SImode:
> case V2DFmode:
> + case V64QImode:
> + case V32HImode:
> case V2DImode:
> case V4SFmode:
> case V4SImode:
> @@ -39821,6 +39823,9 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum
> machine_mode mode,
> goto widen;
>
> case V8HImode:
> + if (TARGET_AVX512VL)
> + return ix86_vector_duplicate_value (mode, target, val);
> +
Shouldn't that be TARGET_AVX512VL && TARGET_AVX512BW ?
> if (TARGET_SSE2)
> {
> struct expand_vec_perm_d dperm;
> @@ -39851,6 +39856,9 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum
> machine_mode mode,
> goto widen;
>
> case V16QImode:
> + if (TARGET_AVX512VL)
> + return ix86_vector_duplicate_value (mode, target, val);
> +
Ditto.
> if (TARGET_SSE2)
> goto permute;
> goto widen;
> @@ -39880,16 +39888,19 @@ ix86_expand_vector_init_duplicate (bool mmx_ok,
> enum machine_mode mode,
>
> case V16HImode:
> case V32QImode:
> - {
> - enum machine_mode hvmode = (mode == V16HImode ? V8HImode : V16QImode);
> - rtx x = gen_reg_rtx (hvmode);
> + if (TARGET_AVX512VL)
> + return ix86_vector_duplicate_value (mode, target, val);
Ditto.
> @@ -40503,6 +40515,42 @@ half:
> gen_rtx_VEC_CONCAT (mode, op0, op1)));
> return;
>
> + case V64QImode:
> + quarter_mode = V16QImode;
> + half_mode = V32QImode;
> + goto quarter;
> +
> + case V32HImode:
> + quarter_mode = V8HImode;
> + half_mode = V16HImode;
> + goto quarter;
I wonder whether for these modes it can ever be beneficial to build them
through interleaves/concatenations etc., if it wouldn't be better to build
them by storing all values into memory and just reading it back.
> -(define_mode_iterator VI48F_512 [V16SI V16SF V8DI V8DF])
> +(define_mode_iterator VI48F_I12_AVX512BW
> + [V16SI V16SF V8DI V8DF
> + (V32HI "TARGET_AVX512BW") (V64QI "TARGET_AVX512BW")])
What does the I12 stand for? Wasn't it meant to be VI48F_512_AVX512BW
or I512?
> (define_mode_iterator VI48F
> [V16SI V16SF V8DI V8DF
> (V8SI "TARGET_AVX512VL") (V8SF "TARGET_AVX512VL")
> @@ -17472,7 +17474,7 @@
> })
>
> (define_expand "vec_init<mode>"
> - [(match_operand:VI48F_512 0 "register_operand")
> + [(match_operand:VI48F_I12_AVX512BW 0 "register_operand")
> (match_operand 1)]
> "TARGET_AVX512F"
> {
Jakub