This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: fmax/fmin sNaN compatibility question
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 9 Dec 2019 17:23:11 +0000
- Subject: Re: fmax/fmin sNaN compatibility question
- Ironport-sdr: n9Blq8iaj0HNw/xJikrXM1hRjjJIY8V4ZBTQ8len2Y5nSok5YwX+sxDzV8Abls5Esinp/u5LSi 6TIeR+JyqTxu7vKD/JCsQ9FEyz7R39TNOqGqKY6+Pjaagq+qnsBjl2YRSQVkYijFTmyQiKOu6a 1FLo+9awPRq4NtBiRJO57hB1ZaJb0ZWgsxAOe3Wz0k6jp19vjnY/5lntuLxhTjEIfKeXeLpUcr h+as16AeIAMaHc6cN9MSlzTcb3m7Wsj+XI903TzB2+VdCzSTcIYqOFBiSTmoyBjYWvlI3OZwkB 2T0=
- Ironport-sdr: htX5uSvn5zgTarPKTjEfGVsw5kjS8inBjz27v7xQFEdPRWR6UuHaTg4xX/17O5nHgYsZynOzEP eXpkjRN0489bwvnmFa0zZicasVbZAdjw77fQlU7oiNWhb49Ti2iOAj9LwC66c3+z4LcGYOtgVx ODzHXsI4zQhLxCMTv7TSkpOvgmuAMZl3iLt/pGKaCYuh9Qh11YCYceBvl7YKt/FO3zROt+dU25 Fu25VEyudz53GzvepYF0kfqnOyk8PmRb/YhyjVOjaZ3CURr2COhEmY8hXuU6m7HRMIPkKm6c6w HFs=
- References: <20191209171245.DB050D802DA@oc3748833570.ibm.com>
On Mon, 9 Dec 2019, Ulrich Weigand wrote:
> Now I've been looking at TS 18661-1 (either n1809 or n2314) and I don't
> see where it defines the semantics in this way.
>
> In fact, the clearest statement seems to be the sample implementation
> in F.10.9.2, paragraph 3, which according to TS 18661-1 now should be:
>
> {
> double r;
> r = (isgreaterequal(x, y) || isnan(y)) ? x : y;
> (void) canonicalize(&r, &r);
> return r;
> }
See the "Append to footnote 374): Note also that this implementation does
not handle signaling NaNs as required of implementations that define
FP_SNANS_ALWAYS_SIGNAL." in TS 18661-1.
fmax is the maxNum operation from IEEE 754-2008 that was removed in IEEE
754-2019; see the table of operation bindings in TS 18661-1. It is *not*
the maximum or maximumNumber operation from IEEE 754-2019 (there's a
separate proposal for C bindings for those operations, with different
names; implementing those operations has its own complication that they
require -0 to compare less than +0, which maxNum doesn't, although the
choice of a decimal cohort member where both arguments are members of the
same cohort with different quantum exponents is still unspecified).
--
Joseph S. Myers
joseph@codesourcery.com