From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1443 invoked by alias); 26 Jan 2012 16:50:12 -0000 Received: (qmail 1434 invoked by uid 22791); 26 Jan 2012 16:50:11 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_XF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jan 2012 16:49:54 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0QGnsKO022728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 26 Jan 2012 11:49:54 -0500 Received: from mesquite.lan (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0QGnrhU020566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 26 Jan 2012 11:49:54 -0500 Date: Thu, 26 Jan 2012 16:59:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [RFC] Add support for the Renesas rl78 architecture Message-ID: <20120126094952.63384b65@mesquite.lan> In-Reply-To: <4F210048.3000900@redhat.com> References: <20120125165800.5351c291@mesquite.lan> <201201252118.06928.vapier@gentoo.org> <4F210048.3000900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00911.txt.bz2 On Thu, 26 Jan 2012 07:27:04 +0000 Pedro Alves wrote: > 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. Yep, that's my rationale too. :) > While we're at it, can we put the function name at column 0? :-) Oops. Thanks for catching that. Yes, I'll fix that, make the corrections that Joel suggested, and then post a follow up. Thanks to everyone who's looked at it so far! Kevin