tree-vect-stmts.c (vectorizable_operation): Check both VEC_WIDEN_MULT_LO_EXPR and...
authorJakub Jelinek <jakub@redhat.com>
Fri, 29 Jun 2012 05:51:08 +0000 (07:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 29 Jun 2012 05:51:08 +0000 (07:51 +0200)
* tree-vect-stmts.c (vectorizable_operation): Check both
VEC_WIDEN_MULT_LO_EXPR and VEC_WIDEN_MULT_HI_EXPR optabs.
Verify that operand[0]'s mode is TYPE_MODE (wide_vectype).

From-SVN: r189064

gcc/ChangeLog
gcc/tree-vect-stmts.c

index 29ecf36f707414903cb9b4d69ea9855aa7da02ee..7932194836c02de22b6b8a503d27671c26f19dc1 100644 (file)
@@ -1,3 +1,9 @@
+2012-06-29  Jakub Jelinek  <jakub@redhat.com>
+
+       * tree-vect-stmts.c (vectorizable_operation): Check both
+       VEC_WIDEN_MULT_LO_EXPR and VEC_WIDEN_MULT_HI_EXPR optabs.
+       Verify that operand[0]'s mode is TYPE_MODE (wide_vectype).
+
 2012-06-28  Richard Henderson  <rth@redhat.com>
 
        * doc/generic.texi (MULT_HIGHPART_EXPR): Document it.
index b40e68c4060fdd4300ee254ea8c8e0ad9f34579b..a0a03c56d13a7323e6167f3655640c1a1d86fef7 100644 (file)
@@ -3504,14 +3504,19 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
            {
              decl1 = NULL_TREE;
              decl2 = NULL_TREE;
-             optab = optab_for_tree_code (VEC_WIDEN_MULT_HI_EXPR,
+             optab = optab_for_tree_code (VEC_WIDEN_MULT_LO_EXPR,
                                           vectype, optab_default);
              optab2 = optab_for_tree_code (VEC_WIDEN_MULT_HI_EXPR,
                                            vectype, optab_default);
              if (optab != NULL
                  && optab2 != NULL
                  && optab_handler (optab, vec_mode) != CODE_FOR_nothing
-                 && optab_handler (optab2, vec_mode) != CODE_FOR_nothing)
+                 && optab_handler (optab2, vec_mode) != CODE_FOR_nothing
+                 && insn_data[optab_handler (optab, vec_mode)].operand[0].mode
+                    == TYPE_MODE (wide_vectype)
+                 && insn_data[optab_handler (optab2,
+                                             vec_mode)].operand[0].mode
+                    == TYPE_MODE (wide_vectype))
                {
                  for (i = 0; i < nunits_in; i++)
                    sel[i] = !BYTES_BIG_ENDIAN + 2 * i;