This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/6] Andes nds32: machine description of nds32 porting (2).
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Chung-Ju Wu <jasonwucj at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 01 Oct 2013 18:31:19 +0100
- Subject: Re: [PATCH 2/6] Andes nds32: machine description of nds32 porting (2).
- Authentication-results: sourceware.org; auth=none
- References: <CADj25HOO04tn85ZfL2adeHUo8EL7mGwFf8yB4CadofGCNVszVQ at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1307092324060 dot 29921 at digraph dot polyomino dot org dot uk> <51EFF7CA dot 6050601 at gmail dot com> <51F0F2F5 dot 6040905 at gmail dot com> <522CA258 dot 2010403 at gmail dot com> <87six7k4x5 dot fsf at talisman dot default> <5245CAF2 dot 2020106 at gmail dot com>
Chung-Ju Wu <email@example.com> writes:
> + /* Use $r15, if the value is NOT in the range of Is20,
> + we must output "sethi + ori" directly since
> + we may already passed the split stage. */
> + return "sethi\t%0, hi20(%1)\;ori\t%0, %0, lo12(%1)";
> + case 17:
> + return "#";
I don't really understand the comment for case 16. Returning "#"
(like for case 17) forces a split even at the output stage.
In this case it might not be worth forcing a split though, so I don't
see any need to change the code. I think the comment should be changed
to give a different reason though.
> + /* Note that (le:SI X INT_MAX) is not the same as (lt:SI X INT_MIN).
> + We better have an assert here in case GCC does not properly
> + optimize it away. */
> + gcc_assert (code != LE || INTVAL (operands) != INT_MAX);
Sorry, I was being lazy when I said INT_MAX. I really meant INT_MAX on
the target (assuming SImode == int), whereas INT_MAX here is a host thing.
0x7fffffff would be OK.
> + /* Create RbRe_str string.
> + Note that we need to output ',' character if there exists En4 field. */
> + if (REGNO (operands) != SP_REGNUM && REGNO (operands) != SP_REGNUM)
> + RbRe_str = INTVAL (operands) != 0 ? "%0, %1, " : "%0, %1";
> + else
> + RbRe_str = "";
The "RbRe_str =" lines should only be indented by 2 extra spaces, not 4.
Same for pop.
Looks good otherwise, thanks.