From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115108 invoked by alias); 3 Aug 2015 22:08:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115090 invoked by uid 89); 3 Aug 2015 22:08:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oi0-f45.google.com Received: from mail-oi0-f45.google.com (HELO mail-oi0-f45.google.com) (209.85.218.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 22:08:15 +0000 Received: by oizz185 with SMTP id z185so723221oiz.0; Mon, 03 Aug 2015 15:08:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.197.2 with SMTP id v2mr251754oif.80.1438639693188; Mon, 03 Aug 2015 15:08:13 -0700 (PDT) Received: by 10.60.58.41 with HTTP; Mon, 3 Aug 2015 15:08:13 -0700 (PDT) In-Reply-To: <047F276D-C2C2-4119-A416-4271D8F369F2@gmail.com> References: <047F276D-C2C2-4119-A416-4271D8F369F2@gmail.com> Date: Mon, 03 Aug 2015 22:08:00 -0000 Message-ID: Subject: Re: [fortran,patch] Extend IEEE support to all real kinds From: Uros Bizjak To: FX Cc: gfortran , gcc-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-08/txt/msg00131.txt.bz2 On Mon, Aug 3, 2015 at 11:14 PM, FX wrote: > The attached patch extends the IEEE modules to all floating-point kinds. = Last time, when I added IEEE support, I restricted it to the float and doub= le types (real kinds 4 and 8), to be extra safe. After discussion with Uros= Bizjak and some reading, I=E2=80=99ve come to the conclusion that on most = hardware where we support IEEE at all, we do support enough IEEE features o= n extended and quad prec (long double and __float128, on x86_64 hardware) t= o satisfy the Fortran standard. > > So, this enables full IEEE support for all real kinds. Nothing changes to= the underlying architecture, it=E2=80=99s almost exclusively mechanical ch= anges (adding the necessary variants to the interfaces, etc.). > > Bootstrapped and regtested on x86_64-apple-darwin14 (with associated libq= uadmath patch: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00124.html). > OK to commit to trunk? > Index: libgfortran/config/fpu-387.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libgfortran/config/fpu-387.h (revision 226429) > +++ libgfortran/config/fpu-387.h (working copy) > @@ -461,12 +461,12 @@ set_fpu_state (void *state) > > > int > -support_fpu_underflow_control (int kind) > +support_fpu_underflow_control (int kind __attribute__((unused))) > { > if (!has_sse()) > return 0; > > - return (kind =3D=3D 4 || kind =3D=3D 8) ? 1 : 0; > + return 1; > } x86 doesn't support underflow control for long double (x87) and __float128 types, so the above change is wrong. > Index: libgfortran/config/fpu-glibc.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libgfortran/config/fpu-glibc.h (revision 226429) > +++ libgfortran/config/fpu-glibc.h (working copy) > @@ -439,7 +439,7 @@ int > support_fpu_underflow_control (int kind __attribute__((unused))) > { > #if defined(__alpha__) && defined(FE_MAP_UMZ) > - return (kind =3D=3D 4 || kind =3D=3D 8) ? 1 : 0; > + return 1; > #else > return 0; > #endif I'm not sure for alpha, if it supports underflow control for extended types. Let's keep this as is for now, it is trivial to change later. Uros.