This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/49483] unable to vectorize code equivalent to "scalbnf"


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49483

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.06.21 09:26:57
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-21 09:26:57 UTC ---
We at the moment only handle sign-changes, but obviously
we in principle can handle all VIEW_CONVERT_EXPRs.

I'm testing the following, which works for your testcase.

Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c       (revision 175205)
+++ gcc/tree-vect-stmts.c       (working copy)
@@ -2089,6 +2089,9 @@ vectorizable_assignment (gimple stmt, gi
   else
     return false;

+  if (code == VIEW_CONVERT_EXPR)
+    op = TREE_OPERAND (op, 0);
+
   if (!vect_is_simple_use_1 (op, loop_vinfo, bb_vinfo,
                             &def_stmt, &def, &dt[0], &vectype_in))
     {
@@ -2099,7 +2102,8 @@ vectorizable_assignment (gimple stmt, gi

   /* We can handle NOP_EXPR conversions that do not change the number
      of elements or the vector size.  */
-  if (CONVERT_EXPR_CODE_P (code)
+  if ((CONVERT_EXPR_CODE_P (code)
+       || code == VIEW_CONVERT_EXPR)
       && (!vectype_in
          || TYPE_VECTOR_SUBPARTS (vectype_in) != nunits
          || (GET_MODE_SIZE (TYPE_MODE (vectype))
@@ -2134,7 +2138,8 @@ vectorizable_assignment (gimple stmt, gi
       /* Arguments are ready. create the new vector stmt.  */
       FOR_EACH_VEC_ELT (tree, vec_oprnds, i, vop)
        {
-        if (CONVERT_EXPR_CODE_P (code))
+        if (CONVERT_EXPR_CODE_P (code)
+            || code == VIEW_CONVERT_EXPR)
           vop = build1 (VIEW_CONVERT_EXPR, vectype, vop);
          new_stmt = gimple_build_assign (vec_dest, vop);
          new_temp = make_ssa_name (vec_dest, new_stmt);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]