Received: from eggs.gnu.org ([208.118.235.92]:41644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCs4b-0001zT-6K for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:38:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCs4Z-0001fe-O0 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:38:29 -0500 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:41755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCs4Z-0001fW-H6 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:38:27 -0500 Date: Tue, 5 Mar 2013 14:38:19 +0100 From: Aurelien Jarno Message-ID: <20130305133819.GB27655@ohm.aurel32.net> References: <1360521050-29680-1-git-send-email-rth@twiddle.net> <1360521050-29680-9-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1360521050-29680-9-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 08/10] target-mips: Fix check_cp1_64bitmode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, qemu-devel@nongnu.org On Sun, Feb 10, 2013 at 10:30:48AM -0800, Richard Henderson wrote: > COP1X refers to the availability of indexed memory operations, > not whether the FPU has 64-bit registers. > > Signed-off-by: Richard Henderson > --- > target-mips/translate.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/target-mips/translate.c b/target-mips/translate.c > index b3b8dc6..a39e118 100644 > --- a/target-mips/translate.c > +++ b/target-mips/translate.c > @@ -1366,8 +1366,9 @@ static inline void check_cop1x(DisasContext *ctx) > > static inline void check_cp1_64bitmode(DisasContext *ctx) > { > - if (unlikely(~ctx->hflags & (MIPS_HFLAG_F64 | MIPS_HFLAG_COP1X))) > + if (unlikely(!(ctx->hflags & MIPS_HFLAG_F64))) { > generate_exception(ctx, EXCP_RI); > + } > } > I think this is wrong. This check comes from the following patch: http://lists.gnu.org/archive/html/qemu-devel/2007-12/msg00581.html In short check_cp1_64bitmode() is called for COP1X instructions (nabla ones) which need the FPU in 64-bit mode. COP1X instructions might not always been able and might have to be activated (CU3 on MIPS IV, 64-bit operations enabled on MIPS64R1), so checking the ISA is not enough. Maybe the name is misleading, but IMHO the behavior is correct. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net