This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libgfortran]: Fix support_fpu_rounding_mode and add -mieee flags for alpha
- From: FX <fxcoudert at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 2 Jul 2014 11:16:00 +0200
- Subject: Re: [PATCH, libgfortran]: Fix support_fpu_rounding_mode and add -mieee flags for alpha
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4aJVUjr57x+_AO8k81w8Dsf1gshdsL-qbMUX72s+ZoVFA at mail dot gmail dot com>
Dear Uros,
Thanks very much for the patch. I have a few questions:
> the patch removes -O0 from dg-additiona-options in IEEE testsuite, as this always override default optimization flag.
That was my purpose: this test can fail with optimization (on x86_64, IIRC), hence the -O0 should override the default optimization flags in the testsuite.
> * gfortran.dg/ieee/ieee_rounding_1.f90 (dg-additional-options): Add.
If -mfp-rounding-mode=d is required on alpha for IEEE conformance, it should be added to add-ieee-options in lib/fortran-torture.exp, shouldn’t it? Rather than enabled on a case-by-case basis. Also, we might want to document these target-specific options here: https://gcc.gnu.org/onlinedocs/gfortran/IEEE-modules.html
> BTW: On alpha, it is possible to enable underflow handling:
>
> #ifdef __USE_GNU
> /* On later hardware, and later kernels for earlier hardware, we can forcibly
> underflow denormal inputs and outputs. This can speed up certain programs
> significantly, usually without affecting accuracy. */
> enum
> {
> FE_MAP_DMZ = 1UL << 12, /* Map denorm inputs to zero */
> #define FE_MAP_DMZ FE_MAP_DMZ
>
> FE_MAP_UMZ = 1UL << 13, /* Map underflowed outputs to zero */
> #define FE_MAP_UMZ FE_MAP_UMZ
> };
> #endif
>
> FX, if you care for this option, I can help test the patch and
> corresponding testcases.
Yes, that’s interesting. What libc function do you call with those FE_MAP_{D,U}MZ values?
I would also like to enable FTZ for i386/x86_64 at some point, but my issue there is that it’s not “universal”, ie it’s only for SSE math if I understand correctly. One point of view is that it’s better than nothing (especially now that SSE math is probably the most used mode), but another point of view is that it wouldn’t be standard conforming.
FX