Hello,

>> For scenarios like above below condition fails and do not transform the rtx.
>>
>> +          if (GET_CODE (op0) == SUBREG && subreg_lowpart_p (op0)
>> +          && GET_CODE (XEXP (op0 ,0)) == LSHIFTRT
>> +          && CONST_INT_P (XEXP (XEXP (op0 ,0), 1))
>> +          && INTVAL (XEXP (XEXP (op0 ,0), 1)) >= 0
>> +          && INTVAL (XEXP (XEXP (op0 ,0), 1)) < HOST_BITS_PER_WIDE_INT
>> +          && ((INTVAL (XEXP (XEXP (op0, 0), 1))
>> +              + floor_log2 (val1))
>> +              < GET_MODE_PRECISION (as_a <scalar_int_mode> (mode))))
>> +        {
>>
>> The transformation is done only when the AND mask is a compile-time constant
>> and "(msb(mask) + shift) < subreg mode precision", ensuring no loss of 
>> relevant bits.
>>
>> For above case we have (8(mask) + 4(shift) < 8 (QI)), Reason being we don't 
>> apply transform here.
> Clearly I misread this clause (repeatedly I might add).
>
>> +          && GET_CODE (XEXP (op0 ,0)) == LSHIFTRT
> Formatting it.  It should be "XEXP (op0, 0)", the whitespace goes after the 
> comma, not before.  This is repeated in several of your expressions in that 
> conditional.
>
>> +          if (GET_CODE (tem) == SUBREG)
>> +            {
>> +              if (subreg_lowpart_p (tem))
>> +            tem = SUBREG_REG (tem);
>> +              else
>> +            goto no_xform;
>> +            }
> Does this happen often enough to matter?  Is there a way to restructure to 
> avoid the goto?  If a goto is really the cleanest form I would go with a 
> generic name rather than something referring to a ppc concept (xform).    
> Perhaps set tem to NULL_RTX is that else clause, then guard the code 
> following the cause above with an outer if (tem)?
>
> Jeff
Noted!

Will send the patch v3, with updated changes!

Kishan 

Reply via email to