From patchwork Thu Dec 17 16:37:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 58610 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp477171lbb; Thu, 17 Dec 2015 08:37:56 -0800 (PST) X-Received: by 10.66.216.7 with SMTP id om7mr72784909pac.90.1450370275857; Thu, 17 Dec 2015 08:37:55 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u27si13381687pfi.167.2015.12.17.08.37.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Dec 2015 08:37:55 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-65741-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libc-alpha-return-65741-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-65741-patch=linaro.org@sourceware.org; dkim=pass header.i=@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=InzUfaxHi32GnrVSKHUAN8UKhXH9CEh0v/HorJ4M1Ls9oDyJYoUmx IF8V4F4LFQuSF8tzpfZTp2oZSuxRGr4jQD9A4RAPmb8NIOT6o73jV9QhSwDfViJS PqB2Jtg7yjEdSlQWijksPVySm1X9icLjhaqebJJRgJSJqjIn7ErjEQ= 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:from:to:subject:date:message-id; s=default; bh=jal1TlAX5MaaNZoX8ksb6E8SyPo=; b=SAZO+J4p+8pwskcPjvE4E54CHHjm JolSF1v68Sy/kaup8ld6MRRq4c9jL/SQf1P02OsW2Jnbu75OKFiDTnhlsfLcl6L7 UCARsH8QnMC0CpBZbd5UtM1xNBkMtLkU+/A46vl8oCfE4+SQGd9LqOI+X/yQW64C eLqgkXz9EvUltDg= Received: (qmail 22750 invoked by alias); 17 Dec 2015 16:37:43 -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 22648 invoked by uid 89); 17 Dec 2015 16:37:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=chip, 586, 587, 58, 7 X-HELO: mail-yk0-f175.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=jtyewbhv26ce2MrO46ZGpSyUDuk3+sQyj4kCHqcWvhM=; b=dxWgqXGtTIFJArrRtM7/dapoob5QlrHdjZkrBny3k7dxDj9lPG+fP3Lt18Ppi0rBGR DIXoxEYUvwhZrHvDGwBhr5Bm93mkfWkPCUJBt1H6uvHyumhbZ81mVKnWrUWgMNNo3gXV /wZJtClM+dWCyfoe2xL26rjQdfqOZpgzjoD/a67NgK4OBllMzDipsF44xekIbeCvrZj9 rIAGVRwj5qD3v8V61n9diJuW7tV3KikwOgSVDJyB/dGmv/nT7KbeqKoT7raCohezi9vB EU5qrvhwLyDnyYywCsp0zfQBBnIfPZBt+cEcdPguE8YZtTQx1P6OwdgQpKm5XKH8Wjyy UUyw== X-Gm-Message-State: ALoCoQkJigH97pF300auPfWUAkc7cEH5ZMu1D1T4gC1xqOhA+JhKpXwZZZsNmruLjOB5EOWxeoMmDcD5Ce0xsQmUHnXbEOUCeA== X-Received: by 10.13.202.206 with SMTP id m197mr12256138ywd.273.1450370255237; Thu, 17 Dec 2015 08:37:35 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] Fix POWER7 logb results for negative subnormals (bug 19375) Date: Thu, 17 Dec 2015 14:37:25 -0200 Message-Id: <1450370245-3766-1-git-send-email-adhemerval.zanella@linaro.org> The optimized POWER7 logb implementation does not use the absolute value of the word extracted from the input to apply the leading 0-bits builtin (to ignore the float sign). This patch fixes it by clearing the signal bit in the resulting word. It fixes the subnormal tests failures when running on POWER7 ou newer chip. Tested on powerpc64le (POWER8). [BZ# 19375] * sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for negative subnormals. --- sysdeps/powerpc/power7/fpu/s_logb.c | 1 + 2 files changed, 6 insertions(+) -- 1.9.1 diff --git a/sysdeps/powerpc/power7/fpu/s_logb.c b/sysdeps/powerpc/power7/fpu/s_logb.c index c5feb67..abd1c2a 100644 --- a/sysdeps/powerpc/power7/fpu/s_logb.c +++ b/sysdeps/powerpc/power7/fpu/s_logb.c @@ -58,6 +58,7 @@ __logb (double x) int ma; EXTRACT_WORDS (ix, lx, x); + ix &= 0x7fffffff; if (ix == 0) ma = __builtin_clz (lx) + 32; else