mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: libm
Date: Mon, 5 Mar 2012 09:51:35 +0100	[thread overview]
Message-ID: <20120305085135.GC5728@port70.net> (raw)
In-Reply-To: <20120304184339.GV184@brightrain.aerifal.cx>

* Rich Felker <dalias@aerifal.cx> [2012-03-04 13:43:39 -0500]:
> On Sun, Mar 04, 2012 at 03:50:41PM +0100, Szabolcs Nagy wrote:
> > maybe it should be called __rem_pio2_large ?
> 
> That's better. Not sure what the best name would be..
> 
renamed

> > i wrote it using generic since i couldnt come up with
> > any way to solve it in c99
> 
> There's no way to solve it in C99 matching the return types, but if
> you don't care about return types, it's pretty easy (albeit ugly and
> verbose) with ?: conditionals based on sizeof(x).
> 
hm i haven't even thought about return types

my problem was calling the double version of a function when the
arg is integral and the float version when the arg is float.
(it can be done with sizeof if we can assume there is a larger
integer type than float, but i thought that was ugly)

even if we don't care about return types and int arguments
it seems tgmath is very ugly

> > complex is missing but it is not hard to add
> > (if you want to wait for it)
> 
> Either way.
> 
> > the parts i wrote may need some review or testing
> > (it can be done after merging of course)
> 
> Yes, I'm okay with that.
> 

i can do the merge and then you git pull
or you can do it from libm

the long double ifdefs needs to be fixed
and math.h sorted out

> There's the libc-testsuite git repo, and then cluts. Neither is
> musl-specific. The former is much broader in scope; the latter is
> probably more intensive in the few areas it tests.
> 

i know but i'm not content with either of those
imho there should be one libctest repo which is a bit more
organized than libc-testsuit and contains the cluts tests
as well

> > ok so using compound literal
> > i was thinking about this
> > something like this will work
> 
> OK.
> 

i saw that you removed the compound literal definition of
NAN, INFINITY etc from math.h

if we want to keep the headers c89 friendly then
isnan, isinf,.. cannot be defined without function call
maybe use static __isnanf,.. functions?

(i committed a compound literal based implementatoin for now)

> Yes, at least it would be a major undertaking to convert all the code
> and ensure that no bugs are introduced. I think it's fine leaving it
> how it is for now. I still want the fast isnan, etc. for applications
> to use, though (and for use by other parts of libc like printf).
> 

i agree

> The semantics should only be changed if the goal is to consider
> NAN/INF as "large" values too. Of course you also get abs() for free
> using the representation and bitmask. Otherwise, for finite
> comparisons comparing the representations and comparing the
> floating-point values should have the same behavior.
> 
hm but float compare will compile to different instruction
so there is at least performance difference


  reply	other threads:[~2012-03-05  8:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 16:41 libm Szabolcs Nagy
2012-01-23 17:07 ` libm Rich Felker
2012-01-23 19:12   ` libm Szabolcs Nagy
2012-01-27 16:02     ` libm Szabolcs Nagy
2012-01-27 19:01       ` libm Pascal Cuoq
2012-01-27 19:34         ` libm Rich Felker
2012-01-29 16:34           ` libm Szabolcs Nagy
2012-02-27 21:02   ` libm Szabolcs Nagy
2012-02-27 22:24     ` libm Rich Felker
2012-03-03 22:57       ` libm Szabolcs Nagy
2012-03-04  6:53         ` libm Rich Felker
2012-03-04 14:50           ` libm Szabolcs Nagy
2012-03-04 18:43             ` libm Rich Felker
2012-03-05  8:51               ` Szabolcs Nagy [this message]
2012-03-05 14:04                 ` libm Rich Felker
2012-03-05 15:17                   ` libm Szabolcs Nagy
2012-03-05 15:25                     ` libm Rich Felker
2012-03-09 10:22                     ` libm Rich Felker
2012-03-09 10:57                       ` libm Szabolcs Nagy
2012-03-09 16:01                         ` libm Rich Felker
2012-03-09 11:09                       ` libm Szabolcs Nagy
2012-03-09 15:56                         ` libm Rich Felker
2012-03-09 17:02                           ` libm Rich Felker
2012-03-10  3:28                             ` libm Rich Felker
2012-03-10 12:45                               ` libm Szabolcs Nagy
2012-03-10 13:12                                 ` libm Rich Felker
2012-03-10 16:38                                   ` libm Szabolcs Nagy
2012-03-05 11:08             ` libm Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120305085135.GC5728@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).