Hi,
I have replaced "expand_mult" to "expand_widening_mult" and removed
all direct references to DImode, SImode modes in the
expand_mult_highpart_optab funtion. The attached patch was tested on
arm-7l, mips-32r2 (74k), i686 without new regressions. Richard, do you
think it is ready now?
                    thanks, Dinar.

On Tue, May 22, 2012 at 7:45 PM, Richard Henderson <r...@redhat.com> wrote:
> On 05/22/12 07:05, Dinar Temirbulatov wrote:
>> +  if ((size - 1 > BITS_PER_WORD
>> +       && BITS_PER_WORD == 32 && mode == DImode)
>
> Do note that this patch will not go in with hard-coded
> SImode and DImode references.
>
> Which, really, you do not even need.
>
>  && GET_MODE_BITSIZE (mode) == 2*BITS_PER_WORD
>
> is what you wanted for testing for double-word-ness,
> and word_mode is a good substitute for SImode here.
>
> +      /* Splitting the 64-bit constant for the higher and the lower parts.  
> */
> +      y0 = gen_rtx_CONST_INT (DImode, d&UINT32_MAX);
> +      y1 = gen_rtx_CONST_INT (DImode, d>>32);
>
> Use gen_int_mode.
>
>> +      x1 = convert_to_mode (DImode, x1, 1);
>> +      x0 = convert_to_mode (DImode, x0, 1);
>> +
>> +      /* Splitting the 64-bit constant for the higher and the lower parts.  
>> */
>> +      y0 = gen_rtx_CONST_INT (DImode, d&UINT32_MAX);
>> +      y1 = gen_rtx_CONST_INT (DImode, d>>32);
>> +
>> +      z2 = gen_reg_rtx (DImode);
>> +      u0 = gen_reg_rtx (DImode);
>> +
>> +      /* Unsigned multiplication of the higher multiplier part
>> +      and the higher constant part.  */
>> +      z2 = expand_mult(DImode, x1, y1, z2, 1);
>> +      /* Unsigned multiplication of the lower multiplier part
>> +         and the higher constant part.  */
>> +      u0 = expand_mult(DImode, x0, y1, u0, 1);
>
> I'm fairly sure you really want to be using expand_widening_mult
> here, rather than using convert_to_mode first.  While combine may
> be able to re-generate a widening multiply out of this sequence,
> there's no sense making it work too hard.
>
>
>
> r~
2012-05-25  Dinar Temirbulatov  <dtemirbula...@gmail.com>
            Alexey Kravets  <mr.kayr...@gmail.com>
          
        * config/arm/arm.c (arm_rtx_costs_1): Add cost estimate for the integer
        double-word division operation.
        * config/mips/mips.c (mips_rtx_costs): Extend cost estimate for the 
integer
        double-word division operation for 32-bit targets.
        * gcc/expmed.c (expand_mult_highpart_optab): Allow to generate the 
higher multipilcation
        product for unsigned double-word integers using 32-bit wide registers.

Attachment: 22.patch
Description: Binary data

Reply via email to