From owner-freebsd-numerics@FreeBSD.ORG Mon Sep 2 11:06:49 2013 Return-Path: Delivered-To: freebsd-numerics@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 777D3143 for ; Mon, 2 Sep 2013 11:06:49 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64EBF23AE for ; Mon, 2 Sep 2013 11:06:49 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r82B6nfj016111 for ; Mon, 2 Sep 2013 11:06:49 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r82B6mF5016109 for freebsd-numerics@FreeBSD.org; Mon, 2 Sep 2013 11:06:48 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 2 Sep 2013 11:06:48 GMT Message-Id: <201309021106.r82B6mF5016109@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-numerics@FreeBSD.org Subject: Current problem reports assigned to freebsd-numerics@FreeBSD.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2013 11:06:49 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o stand/175811 numerics libstdc++ needs complex support in order use C99 o bin/170206 numerics [msun] [patch] complex arcsinh, log, etc. o stand/82654 numerics C99 long double math functions are missing 3 problems total. From owner-freebsd-numerics@FreeBSD.ORG Thu Sep 5 08:52:19 2013 Return-Path: Delivered-To: freebsd-numerics@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4FE292E7; Thu, 5 Sep 2013 08:52:19 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6DE2C4D; Thu, 5 Sep 2013 08:52:18 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r858qGXa061394 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 5 Sep 2013 08:52:17 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/mixed; boundary="Apple-Mail=_25E7D4EE-FF10-4A0A-8154-123F69905584" Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: clang+libc++ using missing powl From: David Chisnall In-Reply-To: <20130904223842.GB82066@ithaqua.etoilebsd.net> Date: Thu, 5 Sep 2013 09:52:13 +0100 Message-Id: <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1508) Cc: "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 08:52:19 -0000 --Apple-Mail=_25E7D4EE-FF10-4A0A-8154-123F69905584 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: > As a result we have a lot of fallouts of ports complaining about: > undefined reference to `powl' >=20 > It seems like libc++ is relying on a function we don't have yet in = libm, am I > missing something? I've attached a diff that I'd like to commit to msun that should allow = these things to link. This: - Provides thin wrappers around the 8 missing libm functions that libc++ = exposes that just call the double versions - Makes these weak references, so other libraries can replace them with = more precise versions if required - On platforms where long double is greater precision than double (e.g. = x86), it emits a linker warning when they are referenced These can then be replaced by proper versions as they become available = (at which point the linker warnings will go away). David --Apple-Mail=_25E7D4EE-FF10-4A0A-8154-123F69905584 Content-Disposition: attachment; filename=imprecise.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="imprecise.diff" Content-Transfer-Encoding: 7bit Index: Makefile =================================================================== --- Makefile (revision 255091) +++ Makefile (working copy) @@ -53,6 +53,7 @@ e_pow.c e_powf.c e_rem_pio2.c \ e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ + imprecise.c \ k_cos.c k_cosf.c k_exp.c k_expf.c k_rem_pio2.c k_sin.c k_sinf.c \ k_tan.c k_tanf.c \ s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c s_cargl.c \ Index: Symbol.map =================================================================== --- Symbol.map (revision 255091) +++ Symbol.map (working copy) @@ -270,4 +270,14 @@ log1pl; log2l; logl; + # Implemented as weak aliases for imprecise versions + powl; + coshl; + erfcl; + erfl; + lgammal; + powl; + sinhl; + tanhl; + tgammal; }; Index: src/imprecise.c =================================================================== --- src/imprecise.c (revision 0) +++ src/imprecise.c (working copy) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2013 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +/* + * If long double is not the same size as double, then these will lose + * precision and we should emit a warning whenever something links against + * them. + */ +#if (LDBL_MANT_DIG > 53) +#define WARN_IMPRECISE(x) \ + __warn_references(x, # x " has lower than advertised precision"); +#else +#define WARN_IMPRECISE(x) +#endif +/* + * Declare the functions as weak variants so that other libraries providing + * real versions can override them. + */ +#define DECLARE_WEAK(x)\ + __weak_reference(imprecise_## x, x);\ + WARN_IMPRECISE(x) + +long double +imprecise_powl(long double x, long double y) +{ + + return pow(x, y); +} +DECLARE_WEAK(powl); + +#define DECLARE_IMPRECISE(f) \ + long double imprecise_ ## f ## l(long double v) { return f(v); }\ + DECLARE_WEAK(f ## l) + +DECLARE_IMPRECISE(cosh); +DECLARE_IMPRECISE(erfc); +DECLARE_IMPRECISE(erf); +DECLARE_IMPRECISE(lgamma); +DECLARE_IMPRECISE(sinh); +DECLARE_IMPRECISE(tanh); +DECLARE_IMPRECISE(tgamma); Property changes on: src/imprecise.c ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property --Apple-Mail=_25E7D4EE-FF10-4A0A-8154-123F69905584-- From owner-freebsd-numerics@FreeBSD.ORG Thu Sep 5 09:58:03 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 527AC881; Thu, 5 Sep 2013 09:58:03 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9879B2034; Thu, 5 Sep 2013 09:58:02 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id hq15so2885909wib.6 for ; Thu, 05 Sep 2013 02:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=uPAk282Bb2KrkapZWatInL/+o6CqfwmZWWxhRKoRmCo=; b=MPAHJjxLITw06ojHv1TiACXsNwC6cKd4MsqjFfmZCJZIRVlUl1I6kJbak6oY/Vvkes XMDvULr5xJ3EUdpO2rkNUWu7V05OD8fvmS09yXStI156Ju2yxJMxU/aRtNhNyMcPabqR jL08OoP2M4Qc9vjUGQRHFCqRFXWrHF3EIHCyl5IPNcz/mEkXK5LYETxj8lnKF1PFRWPJ bsY3CUEi/tV5Nf4M1dTcolPibkSEc80A71wT8HtFadbPDsk/vKybVRb2sOvbJJzx4Mam xJ6jh2qtxd0vyVxV0P/42mWwg7tvNo7JM0NlSOW0mpjyhLFlznY+hW6qUrEPNO7329yx esHw== X-Received: by 10.194.249.97 with SMTP id yt1mr601673wjc.49.1378375081147; Thu, 05 Sep 2013 02:58:01 -0700 (PDT) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id d11sm2627305wic.4.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Sep 2013 02:58:00 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 5 Sep 2013 11:57:58 +0200 From: Baptiste Daroussin To: David Chisnall Subject: Re: clang+libc++ using missing powl Message-ID: <20130905095758.GM82066@ithaqua.etoilebsd.net> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wKTlTxfx0Fr6BT7S" Content-Disposition: inline In-Reply-To: <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 09:58:03 -0000 --wKTlTxfx0Fr6BT7S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 05, 2013 at 09:52:13AM +0100, David Chisnall wrote: > On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: >=20 > > As a result we have a lot of fallouts of ports complaining about: > > undefined reference to `powl' > >=20 > > It seems like libc++ is relying on a function we don't have yet in libm= , am I > > missing something? >=20 > I've attached a diff that I'd like to commit to msun that should allow th= ese things to link. This: >=20 > - Provides thin wrappers around the 8 missing libm functions that libc++ = exposes that just call the double versions >=20 > - Makes these weak references, so other libraries can replace them with m= ore precise versions if required >=20 > - On platforms where long double is greater precision than double (e.g. x= 86), it emits a linker warning when they are referenced >=20 > These can then be replaced by proper versions as they become available (a= t which point the linker warnings will go away). >=20 > David >=20 Thanks I'll test it on my next full run, probably tomorrow. regards, Bapt --wKTlTxfx0Fr6BT7S Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlIoVaYACgkQ8kTtMUmk6EzFngCgpwEpBxuR4Qo39E1pKx+SSaNm MFYAnjNp9LullZD6OhO5LzrVAUgGVrYD =kc4V -----END PGP SIGNATURE----- --wKTlTxfx0Fr6BT7S-- From owner-freebsd-numerics@FreeBSD.ORG Thu Sep 5 21:10:00 2013 Return-Path: Delivered-To: freebsd-numerics@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CD4ED89B; Thu, 5 Sep 2013 21:10:00 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A172120CA; Thu, 5 Sep 2013 21:10:00 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id r85L9r4P058538; Thu, 5 Sep 2013 14:09:53 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id r85L9rLa058537; Thu, 5 Sep 2013 14:09:53 -0700 (PDT) (envelope-from sgk) Date: Thu, 5 Sep 2013 14:09:53 -0700 From: Steve Kargl To: David Chisnall Subject: Re: clang+libc++ using missing powl Message-ID: <20130905210953.GA58413@troutmask.apl.washington.edu> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 21:10:00 -0000 On Thu, Sep 05, 2013 at 09:52:13AM +0100, David Chisnall wrote: > On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: > > > As a result we have a lot of fallouts of ports complaining about: > > undefined reference to `powl' > > > > It seems like libc++ is relying on a function we don't have yet > > in libm, am I missing something? > > I've attached a diff that I'd like to commit to msun Why not disable libc++ from exposing these functions? -- Steve From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 6 06:54:56 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6603CCB5; Fri, 6 Sep 2013 06:54:56 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 347D52D8A; Fri, 6 Sep 2013 06:54:55 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r866sq7o069375 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 6 Sep 2013 06:54:54 GMT (envelope-from theraven@freebsd.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: clang+libc++ using missing powl From: David Chisnall In-Reply-To: <20130905210953.GA58413@troutmask.apl.washington.edu> Date: Fri, 6 Sep 2013 07:54:46 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> <20130905210953.GA58413@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1508) Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 06:54:56 -0000 On 5 Sep 2013, at 22:09, Steve Kargl = wrote: > On Thu, Sep 05, 2013 at 09:52:13AM +0100, David Chisnall wrote: >> On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: >>=20 >>> As a result we have a lot of fallouts of ports complaining about: >>> undefined reference to `powl' >>>=20 >>> It seems like libc++ is relying on a function we don't have yet >>> in libm, am I missing something? >>=20 >> I've attached a diff that I'd like to commit to msun >=20 > Why not disable libc++ from exposing these functions? Because they're in the C++ spec and they should work. I consider this a = placeholder until we have the real versions in the tree (the wiki says = you have coshl, sinhl, and tanhl, in progress, any idea of an ETA for = them)? =20 David From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 6 15:59:40 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA33049F; Fri, 6 Sep 2013 15:59:40 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96E512AAD; Fri, 6 Sep 2013 15:59:40 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id r86Fxdfv063771; Fri, 6 Sep 2013 08:59:39 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id r86FxdRt063770; Fri, 6 Sep 2013 08:59:39 -0700 (PDT) (envelope-from sgk) Date: Fri, 6 Sep 2013 08:59:39 -0700 From: Steve Kargl To: David Chisnall Subject: Re: clang+libc++ using missing powl Message-ID: <20130906155939.GA63661@troutmask.apl.washington.edu> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> <20130905210953.GA58413@troutmask.apl.washington.edu> <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 15:59:40 -0000 On Fri, Sep 06, 2013 at 07:54:46AM +0100, David Chisnall wrote: > > On 5 Sep 2013, at 22:09, Steve Kargl wrote: > > > On Thu, Sep 05, 2013 at 09:52:13AM +0100, David Chisnall wrote: > >> On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: > >> > >>> As a result we have a lot of fallouts of ports complaining about: > >>> undefined reference to `powl' > >>> > >>> It seems like libc++ is relying on a function we don't have yet > >>> in libm, am I missing something? > >> > >> I've attached a diff that I'd like to commit to msun > > > > Why not disable libc++ from exposing these functions? > > Because they're in the C++ spec and they should work. > I consider this a placeholder until we have the real versions > in the tree (the wiki says you have coshl, sinhl, and tanhl, > in progress, any idea of an ETA for them)? Well, your commit has pre-empted any discussion on whether there would have been a better kludge. Oh well. Concerning coshl, sinhl, and tanhl. I had integrated bde's code into msun and prepared a patch to commit over a week ago. Unfortunately, my testing on sparc64 revealed a few issues with tanhl, and Bruce and I are still discussing the fix. PS: I have working erfl and erfcl for ld80 archs. I'm still testing and refining the code. It turns out that computing the needed rational approximation is fairly difficult (at least for me). -- Steve From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 6 16:51:33 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E053F1B7; Fri, 6 Sep 2013 16:51:33 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD4D52ECE; Fri, 6 Sep 2013 16:51:33 +0000 (UTC) Received: from c120.sec.cl.cam.ac.uk (c120.sec.cl.cam.ac.uk [128.232.18.120]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r86GpTnD072524 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 6 Sep 2013 16:51:30 GMT (envelope-from theraven@freebsd.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: clang+libc++ using missing powl From: David Chisnall In-Reply-To: <20130906155939.GA63661@troutmask.apl.washington.edu> Date: Fri, 6 Sep 2013 17:51:29 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <771A7CDD-CE0C-45DE-9367-6E1C3E43A30C@freebsd.org> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> <20130905210953.GA58413@troutmask.apl.washington.edu> <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> <20130906155939.GA63661@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1508) Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 16:51:34 -0000 On 6 Sep 2013, at 16:59, Steve Kargl = wrote: > Well, your commit has pre-empted any discussion on whether > there would have been a better kludge. Oh well. I'm very happy for it to be replaced by something better (and would be = ecstatic for it to go away completely and for all of the functions to = have full-precision implementations). > Concerning coshl, sinhl, and tanhl. I had integrated bde's > code into msun and prepared a patch to commit over a week ago. > Unfortunately, my testing on sparc64 revealed a few issues > with tanhl, and Bruce and I are still discussing the fix. Good to hear. > PS: I have working erfl and erfcl for ld80 archs. I'm still > testing and refining the code. It turns out that computing > the needed rational approximation is fairly difficult (at least > for me). That's great too. Please do poke re@ about committing these after the code freeze if = they're done before 10.0 ships. It would be great to have them in for = the release. David From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 6 19:02:19 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B3BC5C7F; Fri, 6 Sep 2013 19:02:19 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [IPv6:2607:f8b0:400c:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 395722729; Fri, 6 Sep 2013 19:02:19 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id jw12so1988428veb.9 for ; Fri, 06 Sep 2013 12:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QZkTcr1nmxdo+EJDSH5W7hlYTV1Uqc4viN32Kte1nP4=; b=ez66mmLj4U9PsSFfYAulAb8mlH5t88haQVspLMFVjkMbNFVgEXBUUihcV2mgbOy3Ab 5KoRFaiKwTjkr6QZ1fEXx/i6tNxo3bFjoP+91m2KNskOumSnD7p/l/FP1W4jqha8HwAd IgvYTY+KMYLBL7I8yZCyxk8B3S5GNY9RKJnQBWgksR8Ij/hvhGEwTEkpeo9Ly7KomMfJ kb5TeooBAKMjbatovifBr87kGt5YvlyVf/A6/CGl1Vu0ju/54F86+o+TO5yoYPUbASju r42Ru1LeCu15pbiZTBf4LqUXj/uNnde358s/tcl0epM+eY+Vm7F6I5gLAicAqHVm+EqT i9OQ== MIME-Version: 1.0 X-Received: by 10.58.207.103 with SMTP id lv7mr1232666vec.33.1378494138355; Fri, 06 Sep 2013 12:02:18 -0700 (PDT) Received: by 10.58.118.104 with HTTP; Fri, 6 Sep 2013 12:02:18 -0700 (PDT) In-Reply-To: <20130906155939.GA63661@troutmask.apl.washington.edu> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> <20130905210953.GA58413@troutmask.apl.washington.edu> <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> <20130906155939.GA63661@troutmask.apl.washington.edu> Date: Fri, 6 Sep 2013 15:02:18 -0400 Message-ID: Subject: Re: clang+libc++ using missing powl From: Mehmet Erol Sanliturk To: Steve Kargl Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , David Chisnall , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 19:02:19 -0000 On Fri, Sep 6, 2013 at 11:59 AM, Steve Kargl < sgk@troutmask.apl.washington.edu> wrote: > On Fri, Sep 06, 2013 at 07:54:46AM +0100, David Chisnall wrote: > > > > On 5 Sep 2013, at 22:09, Steve Kargl > wrote: > > > > > On Thu, Sep 05, 2013 at 09:52:13AM +0100, David Chisnall wrote: > > >> On 4 Sep 2013, at 23:38, Baptiste Daroussin wrote: > > >> > > >>> As a result we have a lot of fallouts of ports complaining about: > > >>> undefined reference to `powl' > > >>> > > >>> It seems like libc++ is relying on a function we don't have yet > > >>> in libm, am I missing something? > > >> > > >> I've attached a diff that I'd like to commit to msun > > > > > > Why not disable libc++ from exposing these functions? > > > > Because they're in the C++ spec and they should work. > > I consider this a placeholder until we have the real versions > > in the tree (the wiki says you have coshl, sinhl, and tanhl, > > in progress, any idea of an ETA for them)? > > Well, your commit has pre-empted any discussion on whether > there would have been a better kludge. Oh well. > > Concerning coshl, sinhl, and tanhl. I had integrated bde's > code into msun and prepared a patch to commit over a week ago. > Unfortunately, my testing on sparc64 revealed a few issues > with tanhl, and Bruce and I are still discussing the fix. > > PS: I have working erfl and erfcl for ld80 archs. I'm still > testing and refining the code. It turns out that computing > the needed rational approximation is fairly difficult (at least > for me). > > -- > Steve > Not only for you , because function values are not very "smooth" , and representation by an approximation is very difficult . During many weeks , I am trying to obtain good approximations to cumulative normal distribution and its inverse , without very much success . Approximation to inverse cumulative normal distribution is much more difficult than cumulative normal distribution . I am using Fortran double precision . I think , it is necessary to use an arbitrary precision package for optimization , but I do not have any one . Thank you very much . Mehmet Erol Sanliturk From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 6 19:48:59 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 075B4582; Fri, 6 Sep 2013 19:48:59 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D72942D61; Fri, 6 Sep 2013 19:48:58 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id r86Jmv2x066355; Fri, 6 Sep 2013 12:48:57 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id r86JmvcM066354; Fri, 6 Sep 2013 12:48:57 -0700 (PDT) (envelope-from sgk) Date: Fri, 6 Sep 2013 12:48:57 -0700 From: Steve Kargl To: Mehmet Erol Sanliturk Subject: Re: clang+libc++ using missing powl Message-ID: <20130906194857.GA66345@troutmask.apl.washington.edu> References: <20130904223842.GB82066@ithaqua.etoilebsd.net> <80062343-53CD-4CEF-9C47-3BF614DADB64@FreeBSD.org> <20130905210953.GA58413@troutmask.apl.washington.edu> <4DF3383B-4BE7-4947-886A-AAAD25172F68@freebsd.org> <20130906155939.GA63661@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Baptiste Daroussin , "freebsd-numerics@FreeBSD.org" , David Chisnall , "current@freebsd.org Current" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2013 19:48:59 -0000 On Fri, Sep 06, 2013 at 03:02:18PM -0400, Mehmet Erol Sanliturk wrote: > On Fri, Sep 6, 2013 at 11:59 AM, Steve Kargl < > sgk@troutmask.apl.washington.edu> wrote: > > > > PS: I have working erfl and erfcl for ld80 archs. I'm still > > testing and refining the code. It turns out that computing > > the needed rational approximation is fairly difficult (at least > > for me). > > > Not only for you , because function values are not very "smooth" , and > representation by an approximation is very difficult . During many weeks , > I am trying to obtain good approximations to cumulative normal distribution > and its inverse , without very much success . > > Approximation to > inverse cumulative normal distribution is much more difficult than > cumulative normal distribution . > > I am using Fortran double precision . I think , it is necessary to use an > arbitrary precision package for optimization , but I do not have any one . > If you are using gfortran version 4.7 or newer on FreeBSD, you should be able to use a quad precision type. In addition, if you are using lang/gcc46 or newer on your FreeBSD system, then you have an arbitrary precision library installed (see math/mpfr). -- Steve