From patchwork Mon Apr 28 19:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 734 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id 874C336005B for ; Mon, 28 Apr 2014 12:50:37 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id 366271483522; Mon, 28 Apr 2014 12:50:37 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.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-mx21.g.dreamhost.com (Postfix) with ESMTPS id F1DF3153724A for ; Mon, 28 Apr 2014 12:50:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:to:cc:subject:from:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=kGR2f238VrDRci42kd5CBMqDWhgqF0NKVVVQ/5JzwPB CXcYKFjMDepoGtDWyJXgBOAiySqSxqIGeWyjkiC5/6Bxr5SroKXJDSbN2VUPPoRW v/0tegwjOqAZ6VhUaUECFhNz5TAQ6xTertUm3YQTnWoZj4/3X0BjCSq5iz8g8jk0 = 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:date:message-id:to:cc:subject:from:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=RNj6s7BYPnce7LVFjdiWRkX8tus=; b=nOZYIXSIOqd3aBzvi nSA8FVWk7Vfsj1Y+wA2lCbW0Lo1NBy8GTz09AUKimqHJ6L4C0gNOQHWEvCoT8WsT 2v9/N903eMhueR7Dxuu4AkcmqjX1BVSV/wSCeWT5lT0TbmBRC6tn4JS+ScF/n0FV 6rZbyjGnr3yCQNZBpKYLUmbdlc= Received: (qmail 5994 invoked by alias); 28 Apr 2014 19:50:34 -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 5983 invoked by uid 89); 28 Apr 2014 19:50:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: shards.monkeyblade.net Date: Mon, 28 Apr 2014 15:50:29 -0400 (EDT) Message-Id: <20140428.155029.1127526647005038603.davem@davemloft.net> To: joseph@codesourcery.com Cc: stli@linux.vnet.ibm.com, libc-alpha@sourceware.org Subject: Re: [PATCH COMMITTED] Regenerate sparc ULPs. From: David Miller In-Reply-To: References: <20140414.133656.645482096251855460.davem@davemloft.net> Mime-Version: 1.0 X-DH-Original-To: glibc@patchwork.siddhesh.in From: "Joseph S. Myers" Date: Wed, 23 Apr 2014 15:07:11 +0000 > On Mon, 14 Apr 2014, David Miller wrote: > >> From: Stefan Liebler >> Date: Mon, 14 Apr 2014 10:56:24 +0200 >> >> > on s390 test-ldouble / test-ildoubl shows the same ULP for y1(0x2p+0) >> > (see https://www.sourceware.org/ml/libc-alpha/2014-04/msg00271.html). >> > >> > Please test the posted patch. >> >> Yep, it clears the long-double cases for me. >> >> I still have a large ULP of 10 for test-float's y1_upward(). > > I'm going to guess that this doesn't appear on x86_64 because of the > x86_64 implementation of trig functions using double precision internally > so having smaller error accumulation than the generic flt-32 versions. > Saving / restoring the rounding mode in y1f would seem a reasonable > solution. The following does the trick for me, any objections? It would also be great if Stefan Liebler's bug fix at: https://sourceware.org/ml/libc-alpha/2014-04/msg00148.html got approved as well as that fixes the only other major math test failure I was seeing on sparc. Thanks! 2014-04-28 David S. Miller * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Set round-to-nearest internally in the "|x| >= 2.0" code paths to reduce error accumulation. diff --git a/sysdeps/ieee754/flt-32/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c index cb9f97f..a180968 100644 --- a/sysdeps/ieee754/flt-32/e_j1f.c +++ b/sysdeps/ieee754/flt-32/e_j1f.c @@ -107,6 +107,7 @@ __ieee754_y1f(float x) return -HUGE_VALF+x; /* -inf and overflow exception. */ if(__builtin_expect(hx<0, 0)) return zero/(zero*x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ + SET_RESTORE_ROUNDF (FE_TONEAREST); __sincosf (x, &s, &c); ss = -s-c; cc = s-c;