Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250228224407.GN1827@brightrain.aerifal.cx>
Date: Fri, 28 Feb 2025 17:44:08 -0500
From: Rich Felker <dalias@...c.org>
To: Trevor Gross <tmgross@...ch.edu>
Cc: musl@...ts.openwall.com
Subject: Re: f128 aliases for long double math symbols

On Fri, Feb 28, 2025 at 06:36:09AM -0500, Trevor Gross wrote:
> Hello all,
> 
> On platforms where `long double` is `_Float128`, glibc provides
> aliases of math symbols. For example, on aarch64 `sinl` and `sinf128`
> refer to the same function.
> 
> Would the same be welcome in musl? The advantage this provides is
> certainty that the correct symbol is linked for `_Float128` operations
> without knowledge of what the platform `long double` is configured to
> (e.g. the ongoing PowerPC double-double to IEEE128 migration).

Probably not. While the representations may be the same, as I
understand it long double and _Float128 are distinct types even when
the representations are the same. This means the signatures would be
mismatched and it would be UB calling the alias with the wrong
signature.

In addition, if the functions were standardized, it would violate the
requirement of non-equality of function pointers for distinct
functions.

The reasonable way to do this would probably be with wrapper functions
that just call the long double function. But in general musl also
avoids having the set of implemented functions vary by arch. And for
the most part we don't even have correct quad math library functions.
A few that have exact/exact-rounding requirements should be working,
but most give just ld80-equivalent or even double precision only.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.