From patchwork Tue Jan 11 21:01:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 78432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E043CB6EF2 for ; Wed, 12 Jan 2011 08:05:05 +1100 (EST) Received: from localhost ([127.0.0.1]:59151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PclOF-0003H1-4y for incoming@patchwork.ozlabs.org; Tue, 11 Jan 2011 16:04:27 -0500 Received: from [140.186.70.92] (port=60783 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PclNL-0002To-KB for qemu-devel@nongnu.org; Tue, 11 Jan 2011 16:04:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PclLd-0001MS-EZ for qemu-devel@nongnu.org; Tue, 11 Jan 2011 16:02:51 -0500 Received: from hall.aurel32.net ([88.191.126.93]:47319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PclLd-0001Lh-9c for qemu-devel@nongnu.org; Tue, 11 Jan 2011 16:01:45 -0500 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PclLc-0001nd-Hc; Tue, 11 Jan 2011 22:01:44 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1PclLd-0004fB-5t; Tue, 11 Jan 2011 22:01:45 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 11 Jan 2011 22:01:35 +0100 Message-Id: <1294779698-17694-7-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1294779698-17694-1-git-send-email-aurelien@aurel32.net> References: <1294779698-17694-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 6/9] target-sh4: implement flush-to-zero X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When the FPSCR.DN bit is set, the SH4 FPU treat denormalized numbers as zero. Enable the corresponding softfloat option when this bit is set. Signed-off-by: Aurelien Jarno --- target-sh4/op_helper.c | 1 + target-sh4/translate.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c index 9915e42..76a40bd 100644 --- a/target-sh4/op_helper.c +++ b/target-sh4/op_helper.c @@ -434,6 +434,7 @@ void helper_ld_fpscr(uint32_t val) } else { set_float_rounding_mode(float_round_nearest_even, &env->fp_status); } + set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status); } uint32_t helper_fabs_FT(uint32_t t0) diff --git a/target-sh4/translate.c b/target-sh4/translate.c index bdfa31a..080ff6e 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -205,6 +205,7 @@ static void cpu_sh4_reset(CPUSH4State * env) #else env->fpscr = FPSCR_DN | FPSCR_RM_ZERO; /* CPU reset value according to SH4 manual */ set_float_rounding_mode(float_round_to_zero, &env->fp_status); + set_flush_to_zero(1, &env->fp_status); #endif set_default_nan_mode(1, &env->fp_status); env->mmucr = 0;