https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103660
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 58916 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58916&action=edit vector testcases Note f2 is handled for all OP because of: ``` /* Sink binary operation to branches, but only if we can fold it. */ (for op (tcc_comparison plus minus mult bit_and bit_ior bit_xor lshift rshift rdiv trunc_div ceil_div floor_div round_div trunc_mod ceil_mod floor_mod round_mod min max) /* (c ? a : b) op (c ? d : e) --> c ? (a op d) : (b op e) */ (simplify (op (vec_cond:s @0 @1 @2) (vec_cond:s @0 @3 @4)) (if (TREE_CODE_CLASS (op) != tcc_comparison || types_match (type, TREE_TYPE (@1)) || expand_vec_cond_expr_p (type, TREE_TYPE (@0), ERROR_MARK) || (optimize_vectors_before_lowering_p () /* The following is optimistic on the side of non-support, we are missing the legacy vcond{,u,eq} cases. Do this only when lowering will be able to fixup.. */ && !expand_vec_cond_expr_p (TREE_TYPE (@1), TREE_TYPE (@0), ERROR_MARK))) (vec_cond @0 (op! @1 @3) (op! @2 @4)))) ``` I do think we should handle this without that pattern though. Note also I had to use another variable for f2 to hold 0 because otherwise we switch around the VEC_COND to be similar to f1.