From patchwork Sat Mar 8 17:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 15 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (caibbdcaabja.dreamhost.com [208.113.200.190]) by wilcox.dreamhost.com (Postfix) with ESMTP id 81A7F3600AC for ; Sat, 8 Mar 2014 09:44:28 -0800 (PST) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id 21BC362D3E008; Sat, 8 Mar 2014 09:44:28 -0800 (PST) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 0154962CA03EE for ; Sat, 8 Mar 2014 09:44:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=iY2 ErWtrxHvzFBibnbA4NSov9AYOWow1Y6xSuyRkJ6/Z+yQ8I8QLTv/d62WCydeCfAI Obr66Y+CqGChevi9X9R3WiGJkAkR/NuelNVyiSR4zRoZugmJP17VcuX+M3H3xIm6 bRtG6MX0Fvz+zR5zZ1clLpVUIdnyhMpOYukWZUTE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=UzneTdYkb I2bNhvqwsV60Ikl7J0=; b=KGB+Gm3NKft4B7TkJSsLS3vkPDDBxUGRAwy0TwiZG jALWik0JRB+IlVSt9a6YRg2aVxm2CETE2T6PEVFR2nq7Z9pvUFxgj6xP/n2gbafd sSc9NmsEpOEtPEudz98azAVACmPbINw2qpPWtiXeKOlk5MU5LD1qFrnXkfqmhFiv 3w= Received: (qmail 11120 invoked by alias); 8 Mar 2014 17:44:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 11107 invoked by uid 89); 8 Mar 2014 17:44:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp05.br.ibm.com Message-ID: <531B56ED.7020408@linux.vnet.ibm.com> Date: Sat, 08 Mar 2014 14:44:13 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "GNU C. Library" Subject: [COMMITTED] [PATCH] PowerPC: Fix modf/modff optimization return sign X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14030817-1798-0000-0000-000001F39D31 X-DH-Original-To: glibc@patchwork.siddhesh.in I just pushed the above patch that fixes a wrong sign in next test for non-default modf/modff rounding modes. --- ChangeLog | 6 ++++++ sysdeps/powerpc/power5+/fpu/s_modf.c | 4 ++-- sysdeps/powerpc/power5+/fpu/s_modff.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4071f08..5266177 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-03-03 Adhemerval Zanella + + * sysdeps/powerpc/power5+/fpu/s_modf.c (__modf): Fix to return correct + sign in non default rounding modes. + * sysdeps/powerpc/power5+/fpu/s_modff.c (__modff): Likewise. + 2014-03-08 Joseph Myers * math/libm-test.inc (ALL_RM_TEST): New macro. diff --git a/sysdeps/powerpc/power5+/fpu/s_modf.c b/sysdeps/powerpc/power5+/fpu/s_modf.c index eb469f7..06da3ac 100644 --- a/sysdeps/powerpc/power5+/fpu/s_modf.c +++ b/sysdeps/powerpc/power5+/fpu/s_modf.c @@ -36,12 +36,12 @@ __modf (double x, double *iptr) if (x >= 0.0) { *iptr = __floor (x); - return (x - *iptr); + return __copysign (x - *iptr, x); } else { *iptr = __ceil (x); - return (x - *iptr); + return __copysign (x - *iptr, x); } } weak_alias (__modf, modf) diff --git a/sysdeps/powerpc/power5+/fpu/s_modff.c b/sysdeps/powerpc/power5+/fpu/s_modff.c index e4fe857..af17bec 100644 --- a/sysdeps/powerpc/power5+/fpu/s_modff.c +++ b/sysdeps/powerpc/power5+/fpu/s_modff.c @@ -35,12 +35,12 @@ __modff (float x, float *iptr) if (x >= 0.0) { *iptr = __floorf (x); - return (x - *iptr); + return __copysignf (x - *iptr, x); } else { *iptr = __ceilf (x); - return (x - *iptr); + return __copysignf (x - *iptr, x); } } weak_alias (__modff, modff)