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: Tue, 10 Dec 2019 18:05:30 +0000
- Subject: Re: fmax/fmin sNaN compatibility question
- Ironport-sdr: mOHhluYjsgkysEW482HoVP/d6TrQgJCfk9X66HPEa6SzZZkEujKLDEQNXWUy3sGL4+NG6dJTlR 0szOzbYESvXNM/S52W9sWAh6ZNHsmRUepHtXu/D9hrzgsQTH3qvCoCgj9IpRYh9THWPBU1ZGHe xIND5RYRvPozF34SJbxvqMnzKl8udQeDn3X9F4i1gqM6RKwYa/Vg9IW+1Qd2GKITZs3nsquS/I K6okfWvelLVKOnb6h4uLZ1FusTCv4dZONZd65DYPTLmjhGV1Wyxv+CgbHhD/htIvmWzQesKU4a YQQ=
- Ironport-sdr: Trc55cpolLBB7XgsrxvIJxnq5Lzjsco2qY/8j5lMYyHfBGLuRtMrPY+Hrb/X58Ke/sE6o0wWwb qqYZecskHSybSU1z+rbArPyR4WkrCbKuwbwanb3W0AbXH2CEE95vPpAcwA1ZQBt560Ylxn5R0v FX5sG97+EmlyPTqajuzxC6DEkBs51Uyl7AEbM6uWmMwyn+8+x41xSc3nII6mx3mukvQa6ThWMI wwmb26qjDjUtco/XPIqOf4h8OyYB3U9Exn0sm00Dt7ylB9NQuVDLmXqxiEffbMOWl6H3rHysL4 a3c=
- References: <20191210104358.4F372D80305@oc3748833570.ibm.com>
On Tue, 10 Dec 2019, Ulrich Weigand wrote:
> Joseph Myers wrote:
> > On Mon, 9 Dec 2019, Ulrich Weigand wrote:
> > > Do you know why the sample implementation was even updated then?
> > > If FP_SNANS_ALWAYS_SIGNAL is false, shouldn't the C11 method then
> > > still be OK?
> >
> > The canonicalize call is needed in general to avoid propagating
> > noncanonical DFP encodings, though not relevant for binary FP.
>
> But it does change the behavior for binary FP as well, as far
> as I can see: e.g. if both inputs are sNaNs, the C11 method
> would return one of those sNaNs unchanged, while the C2x method
> will return a qNaN (as the canonicalize call will quiet the
> sNaN it receives as input), right?
The handling of sNaN is explicitly implementation-defined when
FE_SNANS_ALWAYS_SIGNAL is not defined, so that example implementation
should not be used to infer anything about how sNaN should be handled.
--
Joseph S. Myers
joseph@codesourcery.com