From nobody Wed Aug 7 08:07:32 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wf2pf1s3Wz5Sv78; Wed, 07 Aug 2024 08:07:38 +0000 (UTC) (envelope-from Paul.Zimmermann@inria.fr) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.inria.fr", Issuer "GEANT OV RSA CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wf2pc4yHvz4G3Q; Wed, 7 Aug 2024 08:07:36 +0000 (UTC) (envelope-from Paul.Zimmermann@inria.fr) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=inria.fr header.s=dc header.b=TGyYgpXQ; dmarc=pass (policy=none) header.from=inria.fr; spf=pass (mx1.freebsd.org: domain of Paul.Zimmermann@inria.fr designates 192.134.164.104 as permitted sender) smtp.mailfrom=Paul.Zimmermann@inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:message-id:from:to:cc:in-reply-to:subject: references:mime-version:content-transfer-encoding; bh=aU9SbO5wgDEpXVznXQbTds17495tmy769NDQB9O6qJc=; b=TGyYgpXQFvmFzQ+DKrQ41lIiIx5Dcz6aQGTAM+zKekMZPRsZFKMFjCE+ KiPib4xW+qzFe/GXhuLxabs6+9aRMaesk7Eqpel6UALY/oYBwZI5h+F/d uUJwr4/Qif+7uMiqTsKh/l8dyH51WMvXKkR9Z61ZWcGRleKRMxPnX6lKs g=; Received-SPF: SoftFail (mail3-relais-sop.national.inria.fr: domain of Paul.Zimmermann@inria.fr is inclined to not designate 152.81.9.227 as permitted sender) identity=mailfrom; client-ip=152.81.9.227; receiver=mail3-relais-sop.national.inria.fr; envelope-from="Paul.Zimmermann@inria.fr"; x-sender="Paul.Zimmermann@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 include:mailout.safebrands.com a:basic-mail.safebrands.com a:basic-mail01.safebrands.com a:basic-mail02.safebrands.com ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail3-relais-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@coriandre) identity=helo; client-ip=152.81.9.227; receiver=mail3-relais-sop.national.inria.fr; envelope-from="Paul.Zimmermann@inria.fr"; x-sender="postmaster@coriandre"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.09,269,1716242400"; d="scan'208";a="93710814" Received: from coriandre.loria.fr (HELO coriandre) ([152.81.9.227]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 10:07:34 +0200 Date: Wed, 07 Aug 2024 10:07:32 +0200 Message-Id: From: Paul Zimmermann To: Konstantin Belousov Cc: hackers@freebsd.org, numerics@freebsd.org In-Reply-To: (message from Konstantin Belousov on Tue, 6 Aug 2024 17:56:38 +0300) Subject: Re: kargl@freebsd.org, sgk@troutmask.apl.washington.edu, vincenzo.innocente@cern.ch, riemannic@gmail.com, johnmather@sidefx.com References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.10 / 15.00]; DWL_DNSWL_MED(-2.00)[inria.fr:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[inria.fr,none]; R_SPF_ALLOW(-0.20)[+ip4:192.134.164.0/24]; R_DKIM_ALLOW(-0.20)[inria.fr:s=dc]; RWL_MAILSPIKE_GOOD(-0.10)[192.134.164.104:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[numerics@freebsd.org,hackers@freebsd.org]; ASN(0.00)[asn:2200, ipnet:192.134.164.0/24, country:FR]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[inria.fr:+] X-Rspamd-Queue-Id: 4Wf2pc4yHvz4G3Q Hi Konstantin, > Date: Tue, 6 Aug 2024 17:56:38 +0300 > From: Konstantin Belousov > Cc: hackers@freebsd.org, numerics@freebsd.org > > On Tue, Aug 06, 2024 at 02:56:01PM +0200, Paul Zimmermann wrote: > > Hi, > > > > we have updated our comparison with FreeBSD 14.1: > > > > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > > > > Remaining issues in 14.1: > > > > * the powl function is not thread-safe > This is for 80-bit long double, am I right? yes > And it is because of the global vars passing values between functions? > > I tried to hack something in https://reviews.freebsd.org/D46237 thanks. I tried to apply your patch on top of openlibm-0.8.3 (after stripping lib/msun). Part of it failed: $ patch -p1 -i /tmp/D46237.diff patching file ld80/e_powl.c Hunk #1 FAILED at 23. Hunk #2 FAILED at 42. Hunk #3 succeeded at 85 (offset -41 lines). Hunk #4 succeeded at 100 (offset -41 lines). Hunk #5 succeeded at 135 (offset -41 lines). Hunk #6 succeeded at 158 (offset -41 lines). Hunk #7 succeeded at 189 (offset -41 lines). $ cat ld80/e_powl.c.rej --- ld80/e_powl.c +++ ld80/e_powl.c @@ -23,10 +23,10 @@ * P[0] x^n + P[1] x^(n-1) + ... + P[n] */ static inline long double -__polevll(long double x, long double *PP, int n) +__polevll(long double x, const long double *PP, int n) { long double y; - long double *P; + const long double *P; P = PP; y = *P++; @@ -42,10 +42,10 @@ * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] */ static inline long double -__p1evll(long double x, long double *PP, int n) +__p1evll(long double x, const long double *PP, int n) { long double y; - long double *P; + const long double *P; P = PP; n -= 1; Also I git compiler warnings (maybe due to the rejected part): ld80/e_powl.c: In function ‘powl’: ld80/e_powl.c:374:29: warning: passing argument 2 of ‘__polevll’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 374 | w = x * ( z * __polevll( x, P, 3 ) / __p1evll( x, Q, 3 ) ); | ^ Apart from that, various tests I did seem to indicate the multi-thread issue has gone, thanks! Paul