[fortran, patch] IEEE intrinsic modules (ping)
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Mon Jul 7 08:56:00 GMT 2014
Hi FX,
>> while the i386/amd64 values are the usual ones. Unfortunately,
>> gcc/fortran/libgfortran.h hardcodes the more common values for
>> GFC_FPE_*, and libgfortran/Makefile.am extracts them from there into
>> fpu-target.inc. I'm unsure what's the best way to handle this.
>
> No, we don’t hardcode any values (unless I misunderstand what you are
> saying). Look at libgfortran/config/fpu-sysv.h get_fpu_rounding_mode() and
> set_fpu_rounding_mode(): we have two switches, to translate between the
> GFC_FPE_* values and the FP_R* values. So this should work, really.
you're right, of course.
> The only thing I can see is that libgfortran/config/fpu-sysv.h assumes that
> FP_RM and others are macros, checking them with "#ifdef FP_RM”. Is that the
> reason?
It is.
> If so, we might just want to use them unconditionally… unless it creates a
> mess on some other SysV target!
FWIW, those FP_* values are also enum values in IRIX 6.5 <ieeefp.h>, the
only other SysV target I have around. Seems this file is common between
all of them, so the risk should be manageable.
The following patch does away with the #ifdef stuff and lets all
gfortran.dg/ieee tests PASS on sparc-sun-solaris2.11.
Ok for mainline?
Rainer
2014-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/fpu-sysv.h (get_fpu_rounding_mode): Use FP_RN, FP_RP,
FP_RM, FP_RZ unconditionally.
(set_fpu_rounding_mode): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libgfortran.patch
Type: text/x-patch
Size: 1494 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140707/aa0de36f/attachment.bin>
-------------- next part --------------
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
More information about the Gcc-patches
mailing list