mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Make musl math depend less on libgcc builtins
Date: Thu, 18 Sep 2014 19:55:47 +0200	[thread overview]
Message-ID: <20140918175546.GV21835@port70.net> (raw)
In-Reply-To: <20140918142840.GA9425@zx-spectrum>

* Sergey Dmitrouk <sdmitrouk@accesssoftek.com> [2014-09-18 17:28:40 +0300]:
> On Thu, Sep 11, 2014 at 07:11:23AM -0700, Szabolcs Nagy wrote:
> > on a correct implementation ==, != are quiet, but <,>,<=,>=
> > raise invalid if any of the operands are nan
> 
> I wanted to get some details on this, but failed to find relevant
> sections of C99/IEEE754 standards.  I see C99 referring to IEEE754, is
> it in "5.11 Details of comparison predicates" section of IEEE754?
> Could you please point me to section(s) I'm apparently missing?

yes ieee754-2008 5.11

i think it is clear: there are tables showing all the predicates
and to which "traditional names and symbols" they should map.

table 5.1 shows ==, != as quiet comparisions, table 5.2 shows
<,> operations as signaling and the text mentions that the quiet
operations in table 5.3 are for applications which want to
explicitly handle quiet nans that way

the text in iso C F.3 is not very detailed about the mapping but
gives hints:

 The relational and equality operators provide IEC 60559 comparisons.
 IEC 60559 identifies a need for additional comparison predicates to
 facilitate writing code that accounts for NaNs. The comparison macros
 (isgreater, isgreaterequal, isless, islessequal, islessgreater, and
 isunordered) in <math.h> supplement the language operators to address
 this need. The islessgreater and isunordered macros provide respectively
 a quiet version of the <> predicate and the unordered predicate
 recommended in the Appendix to IEC 60559.

the <,> predicates need a quiet version because the default is not quiet,
but == and != dont since they are already quiet

the precise mapping will be spelled out in more detail in TS 18661,
 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1778.pdf
see "table - 1 operation binding"
(the latest version seems to be password protected, sigh..)


  reply	other threads:[~2014-09-18 17:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  7:35 Sergey Dmitrouk
2014-09-11  9:47 ` Szabolcs Nagy
2014-09-11 11:42   ` Sergey Dmitrouk
2014-09-11 12:26     ` Szabolcs Nagy
2014-09-11 13:22       ` Sergey Dmitrouk
2014-09-11 14:11         ` Szabolcs Nagy
2014-09-11 15:04           ` Sergey Dmitrouk
2014-09-11 15:14           ` Alexander Monakov
2014-09-11 15:34             ` Szabolcs Nagy
2014-09-18 14:28           ` Sergey Dmitrouk
2014-09-18 17:55             ` Szabolcs Nagy [this message]
2014-09-18 19:21               ` Sergey Dmitrouk

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=20140918175546.GV21835@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).