This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Add support for the Renesas rl78 architecture
- From: Pedro Alves <palves at redhat dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: gdb-patches at sourceware dot org, Kevin Buettner <kevinb at redhat dot com>
- Date: Thu, 26 Jan 2012 07:27:04 +0000
- Subject: Re: [RFC] Add support for the Renesas rl78 architecture
- References: <20120125165800.5351c291@mesquite.lan> <201201252118.06928.vapier@gentoo.org>
On 01/26/2012 02:18 AM, Mike Frysinger wrote:
> On Wednesday 25 January 2012 18:58:00 Kevin Buettner wrote:
>> +/* Return the register address associated with the register specified by
>> + REGNO. */
>> +static unsigned long reg_addr (enum sim_rl78_regnum regno)
>> +{
>> + if (sim_rl78_bank0_r0_regnum <= regno && regno <=
>> sim_rl78_bank0_r7_regnum)
>> + return 0xffef8 + (regno - sim_rl78_bank0_r0_regnum);
>
> the if statements look funny because the operators are reversed. a more
> natural (imo) check:
> if (regno >= sim_rl78_bank0_r0_regnum && regno <= sim_rl78_bank0_r7_regnum)
Funny, I also usually go with Kevin's style. My rationale is that
LOWER_RANGE <= N && N <= UPPER_RANGE
looks more like the mathematical
LOWER_RANGE <= N <= UPPER_RANGE
and thus reads more naturally to me.
While we're at it, can we put the function name at column 0? :-)
--
Pedro Alves