[Bug target/43902] suboptimal MIPS widening multiply accumulate

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Apr 27 09:33:00 GMT 2010



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-04-27 09:33 -------
(In reply to comment #1)
> Some further investigation shows that there is code in expand_expr_real_2 that
> is supposed to be able to generate multiply-accumulate instructions, but it
> isn't general enough.  In my gimple, I have
>   D.1999_10 = D.1998_9 * D.1996_7;
>   total_11 = total_19 + D.1999_10;
> The code in expr.c does
> -      if ((TREE_CODE (type) == INTEGER_TYPE                                    
> -          || TREE_CODE (type) == FIXED_POINT_TYPE)                             
> -         && (subexp0_def = get_def_for_expr (treeop0,  
> -                                             MULT_EXPR)))
> which fails because the multiply operand is treeop1 not treeop0.  We need to
> check both operands for the multiply here.  I have an initial patch that needs
> testing.

For more general optimization you might want to move all this code to
the tree pass before expansion that detects widening multiplication.
The DOT_PROD_EXPR tree code can be used to carry the information to
the expander.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-27 09:33:19
               date|                            |


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



More information about the Gcc-bugs mailing list