https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82137

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-09-12
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Interesting idea.  It's probably a bit hard to make the vectorizer do this
though given it's current structure and the fact that it would have to
cost the extra ops against the saved suffling (the extra cost of the ops
would depent on availability of spare execution resources for example).

In general the interleaving strategy looks like a bit of a dead end with
AVX (and possibly worse on AVX512).  This is how extract even gets expanded:

;; vect_perm_even_21 = VEC_PERM_EXPR <vect_x_13.2_26, vect_x_13.3_22, { 0, 2,
4, 6 }>;

(insn 18 16 17 (set (reg:V4DF 103)
        (vec_select:V4DF (vec_concat:V8DF (reg:V4DF 95 [ vect_x_13.2 ])
                (reg:V4DF 93 [ vect_x_13.3 ]))
            (parallel [
                    (const_int 0 [0])
                    (const_int 4 [0x4])
                    (const_int 2 [0x2])
                    (const_int 6 [0x6])
                ]))) "t2.c":6 {*avx_unpcklpd256}
     (nil))

(insn 17 18 0 (set (reg:V4DF 92 [ vect_perm_even_21 ])
        (vec_select:V4DF (reg:V4DF 103)
            (parallel [
                    (const_int 0 [0])
                    (const_int 2 [0x2])
                    (const_int 1 [0x1])
                    (const_int 3 [0x3])
                ]))) "t2.c":6 4183 {avx2_permv4df_1}
     (nil))

Reply via email to