This is the mail archive of the gcc@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: Processor-specific code


FX Coudert wrote:
[attribution lost]
> > You'll find that globally changing the rounding mode will screw up
> > libm functions.  Which is pretty much going to make this useless.
> 
> OK. I didn't know that, and it's going to be annoying. So, the GNU libm
> doesn't enable us to call mathematical function with non-default
> rounding mode? IIUC, this is a requirement for the Fortran standard.

I believe that you understand incorrectly.

Yes, the standard refers to changing the rounding mode "if the processor
supports [it]" -- but consider what the standard means by "processor":
"The combination of a computing system and the means by which programs
are transformed for use on that computing system is called a processor
in this standard." This very clearly includes the compiler, not just the
hardware.

Thus, the language in section 14.3 of the F2003 standard should be read
as placing requirements on how runtime alterations of the rounding mode
are to be supported _if_ gfortran chooses to support them, but should
not be read as placing requirements on whether gfortran must support
them at all.  It would be perfectly within the standard for gfortran to
leave the rounding mode in the default state, and define the
IEEE_SUPPORT_ROUNDING function to report "FALSE" for anything other than
the default rounding mode.

- Brooks


-- 
The "bmoses-nospam" address is valid; no unmunging needed.


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