On Thu, Jul 3, 2014 at 11:06 AM, FX <fxcoud...@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.

Reply via email to