[PATCH 1/3] expr: Allow scalar_int_mode target mode when converting a constant

Richard Sandiford richard.sandiford@arm.com
Fri Jul 24 14:14:53 GMT 2020


Jozef Lawrynowicz <jozef.l@mittosystems.com> writes:
> On Wed, Jul 22, 2020 at 09:33:47AM +0100, Richard Sandiford wrote:
>> Jozef Lawrynowicz <jozef.l@mittosystems.com> writes:
>> > is_int_mode does not allow MODE_PARTIAL_INT modes, so convert_modes was
>> > not allowing a constant value to be converted to a MODE_PARTIAL_INT for
>> > use as operand 2 in patterns such as ashlpsi3. The constant had
>> > to be copied into a register before it could be used, but now can be
>> > used directly as an operand without any copying.
>> 
>> Yeah.  I guess this dates back to when MODE_PARTIAL_INTs didn't have
>> a known precision.
>
> Is that what the section on MODE_PARTIAL_INT in the description for the
> "subreg" RTX refers to?  From "14.8 Registers and Memory" of gccint:
>
>   A MODE_PARTIAL_INT mode behaves as if it were as wide as the corresponding
>   MODE_INT mode, except that it has an unknown number of undefined bits.

Yeah.  Before d8487c949ad5 the number of significant bits in a partial
mode was hidden from target-independent code.

> If so, that whole section seems out of date. I can work on getting it
> fixed up.

Sounds good :-)

Thanks,
Richard


More information about the Gcc-patches mailing list