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: [fortran, patch] Add Fortran 2003 IEEE intrinsic modules


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.


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