From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzvBj-0006ss-G6 for qemu-devel@nongnu.org; Tue, 02 Jun 2015 19:01:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzvBg-0006gm-Ao for qemu-devel@nongnu.org; Tue, 02 Jun 2015 19:01:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzvBg-0006eq-5u for qemu-devel@nongnu.org; Tue, 02 Jun 2015 19:01:36 -0400 Message-ID: <556E35CB.3070703@codeaurora.org> Date: Tue, 02 Jun 2015 19:01:31 -0400 From: Christopher Covington MIME-Version: 1.0 References: <1433194188-24514-1-git-send-email-aurelien@aurel32.net> <1433194188-24514-2-git-send-email-aurelien@aurel32.net> In-Reply-To: <1433194188-24514-2-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 1/8] target-sh4: use bit number for SR constants List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org Hi Aurelien, On 06/01/2015 05:29 PM, Aurelien Jarno wrote: > Use the bit number for SR constants instead of using a bit mask. This > make possible to also use the constants for shifts. > > Reviewed-by: Richard Henderson > Signed-off-by: Aurelien Jarno > --- > target-sh4/cpu.c | 3 +- > target-sh4/cpu.h | 30 ++++++++++---------- > target-sh4/gdbstub.c | 4 +-- > target-sh4/helper.c | 27 +++++++++--------- > target-sh4/op_helper.c | 26 ++++++++--------- > target-sh4/translate.c | 75 ++++++++++++++++++++++++++------------------------ > 6 files changed, 85 insertions(+), 80 deletions(-) > > diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c > index d187a2b..cccb14f 100644 > --- a/target-sh4/cpu.c > +++ b/target-sh4/cpu.c > @@ -61,7 +61,8 @@ static void superh_cpu_reset(CPUState *s) > env->fpscr = FPSCR_PR; /* value for userspace according to the kernel */ > set_float_rounding_mode(float_round_nearest_even, &env->fp_status); /* ?! */ > #else > - env->sr = SR_MD | SR_RB | SR_BL | SR_I3 | SR_I2 | SR_I1 | SR_I0; > + env->sr = (1u << SR_MD) | (1u << SR_RB) | (1u << SR_BL) | > + (1u << SR_I3) | (1u << SR_I2) | (1u << SR_I1) | (1u << SR_I0); I like using the BIT() macro for this kind of thing. Chris -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project