Re: [PATCH] Use widening_optab_handler when expanding highpart mults

2011-10-05 Thread Andrew Stubbs

On Wed 05 Oct 2011 09:33:09 BST, Andreas Krebbel wrote:

Hi,

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


Apologies, I don't know how I missed that one? :(

Andrew


[PATCH] Use widening_optab_handler when expanding highpart mults

2011-10-05 Thread Andreas Krebbel
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  

* 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))