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 2/6] Andes nds32: machine description of nds32 porting (2).


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

Attachment: 2-nds32-backend-md-part2.v3.revised-4.patch
Description: Binary data


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