Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2013 06:33:52 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        David Chisnall <theraven@FreeBSD.org>
Cc:        "freebsd-numerics@FreeBSD.org" <freebsd-numerics@FreeBSD.org>
Subject:   Re: MUSL math functions
Message-ID:  <20131031133352.GA59918@troutmask.apl.washington.edu>
In-Reply-To: <DFD5EA35-ABDA-4A09-BFC7-9452D650C7FE@FreeBSD.org>
References:  <DFD5EA35-ABDA-4A09-BFC7-9452D650C7FE@FreeBSD.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, Oct 31, 2013 at 10:46:15AM +0000, David Chisnall wrote:
> Hi all,
> 
> MUSL (permissively licensed libc for embedded Linux) appears to include implementations of all of the functions that we're currently missing for C99 compliance.  According to the wiki, we are currently missing:
> 
> 
> clogf, clog, clogl
> coshl, sinhl, tanhl

I have code for coshl, sinhl, and tanhl.

> cexpl
> sincosf, sincos, sincosl

I have code for sincosf, sincos, and sincosl.

> ccosl, ccoshl, csinl, csinhl, ctanl, ctanhl
> cacosl, cacoshl, casinl, casinhl, catanl, catanhl
> erfcl, erfl

I have code for erfcl and erfl.

> powl
> lgammal, tgammal
> cpowf, cpow, cpowl
> 
> The following are marked as either in-progress or patches available:
> 
> clogf, clog, clogl (bde)
> sincosf, sincos, sincosl (kargl)
> cacosl, cacoshl, casinl, casinhl, catanl, catanhl (stephen)
> 
> Are these ready to commit?

coshl, sinhl, tanhl are almost ready.  This requires splitting a
computational kernel out of expl.   sincosf, sincos, and sincosl
need to be retested and reviewed again.  erfcl and erfl need to
be resubmitted for additional review.

>  What are the current blockers for getting them in?

1) Code freeze for FreeBSD-10 came at the wrong time.
2) Got sidetracked on fixing a bug in roundl.
3) Can't update my development systems to FreeBSD-11 (where new
   code should appear) because news/pan does not compile with
   clang++ because clang++ appears to have problems compiling
   headers associated with libc++.
4) ENOTIME.  

> 
> These are present in the MUSL tree.
>

Have you looked at the code?  Hint, I have.  Here's ccoshl().

#include "libm.h"

//FIXME
long double complex ccoshl(long double complex z)
{
	return ccosh(z);
}

> Many are from OpenBSD, some are home-grown:
> 
> coshl, sinhl, tanhl
> ccosl, ccoshl, csinl, csinhl, ctanl, ctanhl
> erfcl, erfl
> powl
> lgammal, tgammal
> cpowf, cpow, cpowl
> 
> cexpl is missing
> 
> Would anyone like to object to importing the ones that are implemented?
> 

Yes.  I object to importing anything from MUSL or OpenBSD or NetBSD
without review or testing.  It also appears that these functions are
only available for ld80 archs.  FreeBSD has both ld80 and ld128.

-- 
Steve



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20131031133352.GA59918>