Topic: SG6 fenv question
Author: "dgutson ." <danielgutson@gmail.com>
Date: Thu, 22 May 2014 14:26:15 -0300
Raw View
Hi,
is there anybody working on floating point exceptions and rounding polici=
es?
IOW, a C++ non-global version of fenv.h?
(by non-global, I mean instantiable FP policies so I can have
some rounding mode in one place, and another in other place).
(Does SG6 have a mailing list?)
Thanks!
Daniel.
--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: David Krauss <potswa@gmail.com>
Date: Fri, 23 May 2014 09:53:20 +0800
Raw View
On 2014-05-23, at 1:26 AM, dgutson . <danielgutson@gmail.com> wrote:
> Hi,
>=20
> is there anybody working on floating point exceptions and rounding polic=
ies?
> IOW, a C++ non-global version of fenv.h?
> (by non-global, I mean instantiable FP policies so I can have
> some rounding mode in one place, and another in other place).
N3797 =A726.3/3: "The floating-point environment has thread storage duratio=
n."
For machines that keep the rounding mode in an FPU flag, changing it would =
likely flush the pipeline at great expense.
You can try making your own RAII class to set and reset flags, and see how =
it affects performance. It won't be practical on all platforms, I don't kno=
w what that does for standardization. But it should work correctly as a use=
r-defined utility, no special machine access needed.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: "dgutson ." <danielgutson@gmail.com>
Date: Thu, 22 May 2014 23:57:32 -0300
Raw View
On Thu, May 22, 2014 at 10:53 PM, David Krauss <potswa@gmail.com> wrote:
>
> On 2014-05-23, at 1:26 AM, dgutson . <danielgutson@gmail.com> wrote:
>
>> Hi,
>>
>> is there anybody working on floating point exceptions and rounding poli=
cies?
>> IOW, a C++ non-global version of fenv.h?
>> (by non-global, I mean instantiable FP policies so I can have
>> some rounding mode in one place, and another in other place).
>
> N3797 =C2=A726.3/3: "The floating-point environment has thread storage du=
ration."
Thanks.
>
> For machines that keep the rounding mode in an FPU flag, changing it woul=
d likely flush the pipeline at great expense.
>
> You can try making your own RAII class to set and reset flags, and see ho=
w it affects performance. It won't be practical on all platforms, I don't k=
now what that does for standardization. But it should work correctly as a u=
ser-defined utility, no special machine access needed.
I see. That answers most of my questions.
However, I don't see any C++-ization of the FPenv: all functions are
just those of the C std.
Macros could be an enum class, except_t could be an object, and maybe
an additional feature of setting the environment to transform
FP-exceptions into C++ exceptions (a sub class family of
std::exception). Is anybody addressing this? Otherwise I'd like to
discuss it in the SG mailing (if any) or here.
Another handy function is to know beforehand whether an arithmetic
operation will underflow or not (e.g. a+b =3D=3D a, b !=3D 0).
Thanks again David.
Daniel.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups=
"ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at http://groups.google.com/a/isocpp.org/group/std-propo=
sals/.
--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Thu, 22 May 2014 21:33:09 -0700
Raw View
Em qui 22 maio 2014, =E0s 23:57:32, dgutson . escreveu:
> an additional feature of setting the environment to transform
> FP-exceptions into C++ exceptions (a sub class family of
> std::exception). Is anybody addressing this? Otherwise I'd like to
> discuss it in the SG mailing (if any) or here.
Transforming FP exceptions into C++ exceptions will most likely require=20
operating system changes (for example, on Unix systems, FP exceptions are=
=20
signalled via Unix signal SIGFPE and signal handlers are a global state, no=
t=20
per-thread, and not library friendly). This might make the proposal=20
unimplementable.
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Marc <marc.glisse@gmail.com>
Date: Fri, 23 May 2014 12:11:36 -0700 (PDT)
Raw View
------=_Part_837_10506751.1400872296944
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Le jeudi 22 mai 2014 19:26:15 UTC+2, dgutson . a =C3=A9crit :
>
> is there anybody working on floating point exceptions and rounding=20
> policies?=20
> IOW, a C++ non-global version of fenv.h?=20
> (by non-global, I mean instantiable FP policies so I can have=20
> some rounding mode in one place, and another in other place).=20
>
=20
See N2899. I don't remember anyone working on it since then.
(Does SG6 have a mailing list?)=20
>
Yes but I don't think it is public.=20
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_837_10506751.1400872296944
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Le jeudi 22 mai 2014 19:26:15 UTC+2, dgutson . a =C3=A9cri=
t :<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"> is there anybod=
y working on floating point exceptions and rounding policies?
<br>IOW, a C++ non-global version of fenv.h?
<br>(by non-global, I mean instantiable FP policies so I can have
<br>some rounding mode in one place, and another in other place).
<br></blockquote><div> <br>See N2899. I don't remember anyone working =
on it since then.<br><br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
>(Does SG6 have a mailing list?)
<br></blockquote><div><br>Yes but I don't think it is public. <br></div></d=
iv>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_837_10506751.1400872296944--
.