This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran, patch] Add Fortran 2003 IEEE intrinsic modules
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, FX <fxcoudert at gmail dot com>
- Date: Thu, 21 Nov 2013 15:59:48 +0100
- Subject: Re: [fortran, patch] Add Fortran 2003 IEEE intrinsic modules
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4bnXJDi9M2L2vRKSAJstsqWV-RUC7Q2hvy1BUo8OHM_+w at mail dot gmail dot com> <Prayer dot 1 dot 3 dot 5 dot 1311211312450 dot 21920 at hermes-2 dot csi dot cam dot ac dot uk>
On Thu, Nov 21, 2013 at 2:12 PM, N.M. Maclaren <nmm1@cam.ac.uk> wrote:
> On Nov 21 2013, Uros Bizjak wrote:
>>>
>>>
>>> Indeed, 387/SSE has flush-to-zero modes. But other APIs do not (glibc,
>>> SysV, AIX). I'm perfectly willing to add it, especially to 387/SSE, if given
>>> a bit of help (someone to write the assembly code).
>>
>>
>> Just set FTZ bit in mxcsr. Please see
>> libgcc/config/i386/crtfastmath.c, this mode is used when -ffast-math
>> is used.
>
>
> Does that work for all of Intel's zoo of floating-point mechanisms?
> Even if gfortran doesn't use all of them, it is important to at least
> know which it works for and which it does not. My understanding of
> the architecture is that all of x87, MMX, SSE and AVX are potentially
> different in this respect :-(
Only SSE and later ABIs support FTZ. Also, please note that underflow
exception has to be masked for FTZ processing to occur. Please see
[1].
[1] http://software.intel.com/en-us/articles/x87-and-sse-floating-point-assists-in-ia-32-flush-to-zero-ftz-and-denormals-are-zero-daz
Uros.