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] Support for IEEE underflow control on x86/x86_64


On Thu, Jul 3, 2014 at 11:06 AM, FX <fxcoudert@gmail.com> wrote:
> Hi all,
>
> The attached patch provides support for underflow control in the IEEE_ARITHMETIC module, for x86/x86_64 targets (our main user base).
> Bootstrapped and regtested on x86_64-apple-darwin13. Comes with a testcase.

+int
+support_fpu_underflow_control (int kind)
+{
+  return (has_sse() && (kind == 4 || kind == 8)) ? 1 : 0;
+}

Please split this condition to improve readability:

if (!has_sse)
  return 0;
...

Index: gcc/testsuite/gfortran.dg/ieee/underflow_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/ieee/underflow_1.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/ieee/underflow_1.f90 (working copy)
@@ -0,0 +1,75 @@
+! { dg-do run }
+! { dg-additional-options "-O0" }
+! { dg-additional-options "-msse -mfpmath=sse" { target { i?86-*-*
x86_64-*-* } } }
+

! { dg-do run }
! { dg-require-effective-target sse2_runtime { target { i?86-*-*
x86_64-*-* } } }
! { dg-additional-options "-msse2 -mfpmath=sse" { target { i?86-*-*
x86_64-*-* } } }

(I don't think -O0 is needed, but have to check with a testsuite run.)

Uros.


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