From patchwork Mon Apr 18 21:00:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 91862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8B360B6FCF for ; Tue, 19 Apr 2011 07:07:13 +1000 (EST) Received: from localhost ([::1]:48222 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBvf4-0002pK-Pt for incoming@patchwork.ozlabs.org; Mon, 18 Apr 2011 17:07:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBvYe-0007TY-0n for qemu-devel@nongnu.org; Mon, 18 Apr 2011 17:00:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBvYc-0004nM-M0 for qemu-devel@nongnu.org; Mon, 18 Apr 2011 17:00:31 -0400 Received: from hall.aurel32.net ([88.191.126.93]:44210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBvYc-0004n3-Fy for qemu-devel@nongnu.org; Mon, 18 Apr 2011 17:00:30 -0400 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.72) (envelope-from ) id 1QBvYb-00028K-Pq; Mon, 18 Apr 2011 23:00:29 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1QBvYV-0005Tp-TZ; Mon, 18 Apr 2011 23:00:23 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Mon, 18 Apr 2011 23:00:11 +0200 Message-Id: <1303160412-8107-20-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1303160412-8107-1-git-send-email-aurelien@aurel32.net> References: <1303160412-8107-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 19/20] target-i386: fix constants wrt softfloat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Aurelien Jarno Reviewed-by: Peter Maydell --- target-i386/exec.h | 8 ++++++++ target-i386/op_helper.c | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/target-i386/exec.h b/target-i386/exec.h index 292e0de..ee36a71 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -124,6 +124,10 @@ static inline void svm_check_intercept(uint32_t type) #define floatx_is_any_nan floatx80_is_any_nan #define floatx_is_neg floatx80_is_neg #define floatx_is_zero floatx80_is_zero +#define floatx_zero floatx80_zero +#define floatx_one floatx80_one +#define floatx_ln2 floatx80_ln2 +#define floatx_pi floatx80_pi #else #define floatx_to_int32 float64_to_int32 #define floatx_to_int64 float64_to_int64 @@ -149,6 +153,10 @@ static inline void svm_check_intercept(uint32_t type) #define floatx_is_any_nan float64_is_any_nan #define floatx_is_neg float64_is_neg #define floatx_is_zero float64_is_zero +#define floatx_zero float64_zero +#define floatx_one float64_one +#define floatx_ln2 float64_ln2 +#define floatx_pi float64_pi #endif #define RC_MASK 0xc00 diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c index 0c4f0da..a9bb80d 100644 --- a/target-i386/op_helper.c +++ b/target-i386/op_helper.c @@ -95,15 +95,25 @@ static const uint8_t rclb_table[32] = { 6, 7, 8, 0, 1, 2, 3, 4, }; +#if defined(CONFIG_SOFTFLOAT) +# define floatx_lg2 make_floatx80( 0x3ffd, 0x9a209a84fbcff799LL ) +# define floatx_l2e make_floatx80( 0x3fff, 0xb8aa3b295c17f0bcLL ) +# define floatx_l2t make_floatx80( 0x4000, 0xd49a784bcd1b8afeLL ) +#else +# define floatx_lg2 (0.30102999566398119523L) +# define floatx_l2e (1.44269504088896340739L) +# define floatx_l2t (3.32192809488736234781L) +#endif + static const CPU86_LDouble f15rk[7] = { - 0.00000000000000000000L, - 1.00000000000000000000L, - 3.14159265358979323851L, /*pi*/ - 0.30102999566398119523L, /*lg2*/ - 0.69314718055994530943L, /*ln2*/ - 1.44269504088896340739L, /*l2e*/ - 3.32192809488736234781L, /*l2t*/ + floatx_zero, + floatx_one, + floatx_pi, + floatx_lg2, + floatx_ln2, + floatx_l2e, + floatx_l2t, }; /* broken thread support */