This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Use widening_optab_handler when expanding highpart mults
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: andrew_stubbs at mentor dot com
- Date: Wed, 5 Oct 2011 10:33:09 +0200
- Subject: [PATCH] Use widening_optab_handler when expanding highpart mults
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))