[PATCH 2/6] Andes nds32: machine description of nds32 porting (2).

Chung-Ju Wu jasonwucj@gmail.com
Wed Oct 16 12:56:00 GMT 2013


2013/10/14 Richard Sandiford <rdsandiford@googlemail.com>:
> Chung-Ju Wu <jasonwucj@gmail.com> writes:
>> +  /* If operands[1] is a large constant and cannot be performed
>> +     move behavior with single instruction, we need to split it.  */
>
> Suggest "...cannot by performed by a single instruction..."
>
>> +      high20_rtx = GEN_INT ((INTVAL (operands[1]) >> 12) << 12);
>
> Better to use gen_int_mode (..., SImode).  Although GEN_INT will be OK
> if the compiler uses an arithmetic shift for >>, that isn't guaranteed
> (although I doubt any modern compiler would use anything else).
>

Modify it accordingly.

>> +      low12_rtx = GEN_INT (INTVAL (operands[1]) & 0xfff);
>> +
>> +      emit_move_insn (tmp_rtx, high20_rtx);
>> +      emit_move_insn (operands[0], plus_constant (SImode,
>> +                                               tmp_rtx,
>> +                                               INTVAL (low12_rtx)));
>
> There's no need to create an rtx and then use INTVAL on it.
> low12 can just be a HOST_WIDE_INT.
>

Modify it accordingly.

> Looks good to me with those changes, thanks.
>
> Richard

Thank you very much.
A revised-4 patch for nds32.md is attached. :)


Best regards,
jasonwucj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-nds32-backend-md-part2.v3.revised-4.patch
Type: application/octet-stream
Size: 71958 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20131016/9b6753a2/attachment.obj>


More information about the Gcc-patches mailing list