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: [Patch, Fortran] PR35862 - add input I/O rounding support - by setting the CPU rounding mode


Le 17/07/2013 11:02, Tobias Burnus a écrit :
> As there is again a CPU dependence:
> - David, can you have a look at config/fpu-aix.h?
> - Eric and Gerald, can you have a look at config/fpu-sysv.h?
> - Uros, can you have a look at config/fpu-387.h?
> 
> All: Does on any of the systems exists a rounding mode like nearest -
> but with rounding away from 0 for a tie? (= Fortran I/O rounding mode
> "compatible".) If not, I will simply continue to use nearest in that
> case - for output it is implemented - and more visible as one might
> output only few digits.
> 
> The patch works by setting the CPU's rounding mode before calling
> "strtof" - which in turn has to handle the rounding mode. That works for
> GLIBC and for libquadmath - but probably not with all libc. Thus, I
> assume that one needs to add a bunch of triplets to "target { ! {... }
> }" to avoid test suite failures. Or, even better, if you have
> suggestions how to fix it for your platform, tell me about it.
> (Admittedly, contrary to output rounding, I think input rounding is not
> as important; the test case uses "0.1" which is the prime example.)
> 
> As (intended) side effect, the patch also adds some functionality which
> can be used when gfortran finally implements Fortran 2003's IEEE modules.
> 
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
> 

The fortran bits look good.

Mikael


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