[PATCH] Use widening_optab_handler when expanding highpart mults

Andreas Krebbel krebbel@linux.vnet.ibm.com
Wed Oct 5 08:40:00 GMT 2011


Hi,

the optab_handler uses in expand_mult_highpart_optab haven't been
replaced with the widening_optab_handler yet.

Fixed with attached patch.

Tested on s390x and x86_64.

Bye,

-Andreas-


2011-10-05  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* expmed.c (expand_mult_highpart_optab): Replace optab_handler
	with the new widening_optab_handler.


Index: gcc/expmed.c
===================================================================
*** gcc/expmed.c.orig
--- gcc/expmed.c
*************** expand_mult_highpart_optab (enum machine
*** 3467,3473 ****
  
    /* Try widening multiplication.  */
    moptab = unsignedp ? umul_widen_optab : smul_widen_optab;
!   if (optab_handler (moptab, wider_mode) != CODE_FOR_nothing
        && mul_widen_cost[speed][wider_mode] < max_cost)
      {
        tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0,
--- 3467,3473 ----
  
    /* Try widening multiplication.  */
    moptab = unsignedp ? umul_widen_optab : smul_widen_optab;
!   if (widening_optab_handler (moptab, wider_mode, mode) != CODE_FOR_nothing
        && mul_widen_cost[speed][wider_mode] < max_cost)
      {
        tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0,
*************** expand_mult_highpart_optab (enum machine
*** 3504,3510 ****
  
    /* Try widening multiplication of opposite signedness, and adjust.  */
    moptab = unsignedp ? smul_widen_optab : umul_widen_optab;
!   if (optab_handler (moptab, wider_mode) != CODE_FOR_nothing
        && size - 1 < BITS_PER_WORD
        && (mul_widen_cost[speed][wider_mode] + 2 * shift_cost[speed][mode][size-1]
  	  + 4 * add_cost[speed][mode] < max_cost))
--- 3504,3510 ----
  
    /* Try widening multiplication of opposite signedness, and adjust.  */
    moptab = unsignedp ? smul_widen_optab : umul_widen_optab;
!   if (widening_optab_handler (moptab, wider_mode, mode) != CODE_FOR_nothing
        && size - 1 < BITS_PER_WORD
        && (mul_widen_cost[speed][wider_mode] + 2 * shift_cost[speed][mode][size-1]
  	  + 4 * add_cost[speed][mode] < max_cost))



More information about the Gcc-patches mailing list