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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
No.

Failed to match this instruction:
(set (reg:V2DF 213 [ D.3605 ])
    (vec_select:V2DF (vec_concat:V4DF (plus:V2DF (reg:V2DF 161 [ vect__69.31 ])
                (reg:V2DF 167 [ vect__68.29 ]))
            (minus:V2DF (reg:V2DF 167 [ vect__68.29 ])
                (reg:V2DF 161 [ vect__69.31 ])))
        (parallel [
                (const_int 0 [0])
                (const_int 3 [0x3])
            ])))

RTL:

(insn 171 170 172 17 (set (reg:V2DF 211 [ vect__64.32 ])
        (plus:V2DF (reg:V2DF 161 [ vect__69.31 ])
            (reg:V2DF 167 [ vect__68.29 ]))) t.f90:9 1387 {*addv2df3}
     (nil))
(insn 172 171 173 17 (set (reg:V2DF 212 [ vect__64.33 ])
        (minus:V2DF (reg:V2DF 167 [ vect__68.29 ])
            (reg:V2DF 161 [ vect__69.31 ]))) t.f90:9 1391 {*subv2df3}
     (expr_list:REG_DEAD (reg:V2DF 167 [ vect__68.29 ])
        (expr_list:REG_DEAD (reg:V2DF 161 [ vect__69.31 ])
            (nil))))
(insn 173 172 174 17 (set (reg:V2DF 213 [ D.3605 ])
        (vec_select:V2DF (vec_concat:V4DF (reg:V2DF 211 [ vect__64.32 ])
                (reg:V2DF 212 [ vect__64.33 ]))
            (parallel [
                    (const_int 0 [0])
                    (const_int 3 [0x3])
                ]))) t.f90:9 2719 {sse2_shufpd_v2df}

looks like you need to allow plus to commutate (not sure if combine has
that ability or if it is just missing for vector modes or if you need to
adjust the pattern itself)

I remember that doing this regresses some of the
i386.exp builtin tests because the backend builds vec_merge in i386.c for them.
Also when using V4SF the middle-end somehow ends up using vec_merge in the
end (and thus it works there already and would break due to your patch).
IIRC the root-cause for that is vec_merge being used by some of the permutation
generation code in i386.c.

That was why I was suggesting to add additional patterns rather than
replacing the existing ones...

Reply via email to