This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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] IEEE intrinsic modules


On Thu, Jun 5, 2014 at 11:35 AM, FX <fxcoudert@gmail.com> wrote:
>> Please look at libgcc/config/i386/crtfastmath.c for how to set
>> MXCSR_FTZ from mxcsr. You already have all necessary bits in place,
>> the function is basically only:
>>
>> +  if (has_sse())
>> +  {
>> +    unsigned int cw_sse;
>> +
>> +    __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (cw_sse));
>> +    cw_sse |= MXCSR_DAZ;
>> +    __asm__ __volatile__ ("%vldmxcsr\t%0" : : "m" (cw_sse));
>> +  }

Oops, the above should read MXCSR_FTZ.

> Thanks for the suggestion!
>
>
>> Please note, that FTZ applies only to SSE math. x87 and (IIRC) soft-FP
>> don't handle this setting.
>
> Yeah, thatâs also why I prefer for now to have it declared as unsupported: the Fortran standard doesnât really allow for partial support such as this, so Iâm still trying to figure out what The Right Thing To Do is.

Referring to some older mails [1], this looks like a performance-only
setting (sort of fast-math). So, we can perhaps just set this bit,
regardless of the details. Maybe soft-fp will grow support for FTZ
sometime, it looks like a useful addition from the performance POV.

[1] https://gcc.gnu.org/ml/fortran/2013-11/msg00133.html

Uros.


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