This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] MIPS: add mips32r2 patterns to generate ext and ins insns.


Nigel Stephens <nigel@mips.com> writes:

> David Ung wrote:
>
>>+ bool
>>+ mips_use_ins_ext_p (rtx op, rtx size, rtx position)
>>+ {
>>+   HOST_WIDE_INT len, pos;
>> + +   if (!ISA_HAS_EXT_INS
>>+       || !register_operand (op, VOIDmode))
>>+     return false;
>> + +   len = INTVAL (size);
>>+   pos = INTVAL (position);
>> +   +   if (len <= 0 || len >= BITS_PER_WORD || pos < 0
>>+       || pos + len > BITS_PER_WORD)
>>+     return false;
>> +
>>
>
> Looking at this go past, I wonder should that test be using
> GET_MODE_BITSIZE (GET_MODE (op)) rather than BITS_PER_WORD?

Good catch.  Yes it should.  And after that change, there should
also be a check that GET_MODE_BITSIZE (GET_MODE (op)) <= BITS_PER_WORD.

As it stands, I suppose this is just future-proofing.  TARGET_64BIT is
never true for mips32r2 anyway.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]