This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Converting floor to rint


Jan Hubicka <jh@suse.cz> writes:

| > Jan Hubicka <jh@suse.cz> writes:
| > 
| > [...]
| > 
| > | >        [#2]  The rint functions differ from the nearbyint functions
| > | >        (7.12.9.3) only in that the rint  functions  may  raise  the
| > | 						      ^^^
| > | Does this imply that I can implement rint as nearbyint call and never
| > | cause the exception and always use frndint instruction for it that does
| > | not trap?
| > 
| > If FE_INEXACT is on, that is incorrect.
| But why the standard don't say that rint function will raise the
| interrupt?

Sorry for having been unclear.

"may" part refers to the fact  whether the programmer might want
to run rint() under a particular floating-point control mode that
would permit rint() to raise the inexact exception.
rint() cannot unconditionally set it. If FENV_ACCESS is on and
FE_INEXACT is supported then rint() should raise the exception if
appropriate. That is my understanding.

Am I still unclear?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]