Received: from eggs.gnu.org ([140.186.70.92]:52324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhwCe-0006WP-BC for qemu-devel@nongnu.org; Mon, 02 Jan 2012 23:42:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RhwCd-0000cS-EM for qemu-devel@nongnu.org; Mon, 02 Jan 2012 23:42:24 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:59804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhwCd-0000bj-6P for qemu-devel@nongnu.org; Mon, 02 Jan 2012 23:42:23 -0500 Received: by mail-wi0-f173.google.com with SMTP id hm2so10106590wib.4 for ; Mon, 02 Jan 2012 20:42:22 -0800 (PST) From: khansa@kics.edu.pk Date: Tue, 3 Jan 2012 09:54:17 +0500 Message-Id: <1325566458-3561-4-git-send-email-khansa@kics.edu.pk> In-Reply-To: <1325566458-3561-1-git-send-email-khansa@kics.edu.pk> References: <1325566458-3561-1-git-send-email-khansa@kics.edu.pk> Subject: [Qemu-devel] [PATCH v4 3/4] target-mips: Fix FPU reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, andreas.faerber@web.de, Khansa Butt , aurelien@aurel32.net, rth@twiddle.net From: Khansa Butt in translate_init.c fpu_init() initializes active_fpu for given cpu model afterwards cpu_reset() resets all the members upto breakpoints due to this whatever the value of cpu_model->CR1_fcr0 was , the value of env->active_fpu.fcr0 is zero now. This patch resolve this issue so that FP operations can be emulated. cpu_reset() can't call fpu_init() as it require to pass mips_def_t *def to cpu_reset() which will break the convention Signed-off-by: Khansa Butt --- target-mips/translate.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index cecdacc..4b97905 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -12731,6 +12731,7 @@ void cpu_reset (CPUMIPSState *env) tlb_flush(env, 1); /* Reset registers to their default values */ + env->active_fpu.fcr0 = env->cpu_model->CP1_fcr0; env->CP0_PRid = env->cpu_model->CP0_PRid; env->CP0_Config0 = env->cpu_model->CP0_Config0; #ifdef TARGET_WORDS_BIGENDIAN -- 1.7.3.4