Received: from eggs.gnu.org ([208.118.235.92]:56000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaUgz-0004HD-Kj for qemu-devel@nongnu.org; Thu, 09 May 2013 13:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaUgy-00074M-Fd for qemu-devel@nongnu.org; Thu, 09 May 2013 13:31:45 -0400 Received: from mail.rt-rk.ftn.uns.ac.rs ([147.91.177.140]:48860 helo=mail.rt-rk.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaUgy-00074E-61 for qemu-devel@nongnu.org; Thu, 09 May 2013 13:31:44 -0400 Received: from mail.rt-rk.com (mail.localdomain [127.0.0.1]) by mail.rt-rk.com (Postfix) with SMTP id D881925BD59 for ; Thu, 9 May 2013 19:31:40 +0200 (CEST) From: Petar Jovanovic Date: Thu, 9 May 2013 19:28:37 +0200 Message-Id: <1368120517-84396-1-git-send-email-petar.jovanovic@rt-rk.com> Subject: [Qemu-devel] [PATCH] target-mips: clean-up in BIT_INSV List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: petar.jovanovic@imgtec.com, aurelien@aurel32.net From: Petar Jovanovic This is a small follow-up change to "fix incorrect behaviour for INSV". It includes two minor modifications: - sizefilter is constant so it can be moved inside of the block, - (int64_t)0x01 is replaced with 1LL for ease of reading. No functional change. Signed-off-by: Petar Jovanovic --- target-mips/dsp_helper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index 9212789..426a3b6 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -2900,11 +2900,12 @@ target_ulong helper_bitrev(target_ulong rt) return (target_ulong)rd; } -#define BIT_INSV(name, posfilter, sizefilter, ret_type) \ +#define BIT_INSV(name, posfilter, ret_type) \ target_ulong helper_##name(CPUMIPSState *env, target_ulong rs, \ target_ulong rt) \ { \ uint32_t pos, size, msb, lsb; \ + uint32_t const sizefilter = 0x3F; \ target_ulong filter; \ target_ulong temp, temprs, temprt; \ target_ulong dspc; \ @@ -2921,7 +2922,7 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong rs, \ return rt; \ } \ \ - filter = ((int64_t)0x01 << size) - 1; \ + filter = (1LL << size) - 1; \ filter = filter << pos; \ temprs = (rs << pos) & filter; \ temprt = rt & ~filter; \ @@ -2930,9 +2931,9 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong rs, \ return (target_long)(ret_type)temp; \ } -BIT_INSV(insv, 0x1F, 0x3F, int32_t); +BIT_INSV(insv, 0x1F, int32_t); #ifdef TARGET_MIPS64 -BIT_INSV(dinsv, 0x7F, 0x3F, target_long); +BIT_INSV(dinsv, 0x7F, target_long); #endif #undef BIT_INSV -- 1.7.9.5