Hi,

On 22/09/26 10:19 pm, Surya Kumari Jangala wrote:
> Is there a reason to convert operand 0 to DI mode instead of 
> changing the rest of the code to handle SI mode?
> We should change the rest of the code in this define_expand
> to handle operand 0 having SI mode. For example, instead of calling
> gen_ashldi3, we should call gen_ashlsi3.
> 
> -Surya

Thanks for the suggestion. My understanding is that the DI change
is required for the following reasons.

The mffscdrn and mtfsf instructions operate on FPRs. operands[0] is an
integer (SImode) value, whereas mffscdrn and mtfsf_hi require a DFmode
register operand. Therefore, a DI temporary is required as the bridge
from the GPR to the DFmode FPR using simplify_gen_subreg, Also a
direct SImode to DFmode conversion is not allowed.
   
gen_ashldi3 cannot be replaced with gen_ashlsi3 because mffscdrn
reads the new DRN value from bits 29:31 of FRB (using IBM bit numbering),
which correspond to bits 32:34. Therefore, the value must be shifted
left by 32 bits to move it from bit 0 to bit 32.

-Jeevitha

Reply via email to