From patchwork Sat Sep 8 21:12:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 182595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DFEE02C0086 for ; Sun, 9 Sep 2012 07:13:34 +1000 (EST) Received: from localhost ([::1]:36843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TASLM-0002lg-RS for incoming@patchwork.ozlabs.org; Sat, 08 Sep 2012 17:13:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TASL6-0002iX-TZ for qemu-devel@nongnu.org; Sat, 08 Sep 2012 17:13:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TASL4-0002El-Ga for qemu-devel@nongnu.org; Sat, 08 Sep 2012 17:13:16 -0400 Received: from hall.aurel32.net ([88.191.126.93]:46524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TASL4-0002EE-9C for qemu-devel@nongnu.org; Sat, 08 Sep 2012 17:13:14 -0400 Received: from [188.85.229.73] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TASL2-0002dv-Th; Sat, 08 Sep 2012 23:13:13 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TASL0-0005Es-Vu; Sat, 08 Sep 2012 23:13:10 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 8 Sep 2012 23:12:45 +0200 Message-Id: <1347138767-19941-3-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347138767-19941-1-git-send-email-aurelien@aurel32.net> References: <1347138767-19941-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: Alexander Graf , Aurelien Jarno Subject: [Qemu-devel] [PATCH 3/5] target-ppc: use the softfloat min/max functions 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 Use the new softfloat float32_min() and float32_max() to implement the vminfp and vmaxfp instructions. As a bonus we can get rid of the call to the HANDLE_NAN2 macro, as the NaN handling is directly done at the softfloat level. Cc: Alexander Graf Signed-off-by: Aurelien Jarno --- target-ppc/int_helper.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c index 5b2a3c8..6141243 100644 --- a/target-ppc/int_helper.c +++ b/target-ppc/int_helper.c @@ -414,6 +414,8 @@ VARITH(uwm, u32) } VARITHFP(addfp, float32_add) VARITHFP(subfp, float32_sub) +VARITHFP(minfp, float32_min) +VARITHFP(maxfp, float32_max) #undef VARITHFP #define VARITHSAT_CASE(type, op, cvt, element) \ @@ -728,27 +730,6 @@ VMINMAX(uw, u32) #undef VMINMAX_DO #undef VMINMAX -#define VMINMAXFP(suffix, rT, rF) \ - void helper_v##suffix(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, \ - ppc_avr_t *b) \ - { \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->f); i++) { \ - HANDLE_NAN2(r->f[i], a->f[i], b->f[i]) { \ - if (float32_lt_quiet(a->f[i], b->f[i], \ - &env->vec_status)) { \ - r->f[i] = rT->f[i]; \ - } else { \ - r->f[i] = rF->f[i]; \ - } \ - } \ - } \ - } -VMINMAXFP(minfp, a, b) -VMINMAXFP(maxfp, b, a) -#undef VMINMAXFP - void helper_vmladduhm(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) { int i;