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: [Patch,Fortran+Build] Use more complicated quad-math config check


* Tobias Burnus wrote on Tue, Feb 15, 2011 at 04:16:57PM CET:
> The solution is to use the same check as for libquadmath. (Additionally, one
> should, e.g., provide the missing bits in libgcc to enable a working
> quadmath support. But that's a separate issue.)
[...]
> Build and regtested on x86-64 linux (and build on NetBSD, cf. PR).
> OK for the trunk?

The patch is OK.

When you have tests that should be the same across several configure
scripts, the right way is to factor them into an appropriate macro and
put them in a toplevel config/*.m4 file.  But IMVHO such a cleanup is
more appropriate for Stage 1.

Thanks,
Ralf

> PS: The result of the configure check is as if libgfortran were build with
> --disable-libquadmath-support. The front end will still believe that
> __float128 [or rather: REAL(16)] is available.

> 2011-02-15  Tobias Burnus  <burnus@net-b.de>
> 
>         PR fortran/47716
>         PR fortran/47648
> 	* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Use check from
> 	libquadmath, which uses more features.
> 	* configure: Regenerate.

> --- a/libgfortran/acinclude.m4
> +++ b/libgfortran/acinclude.m4
> @@ -284,24 +284,33 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
>  
>    AC_CACHE_CHECK([whether we have a usable __float128 type],
>                   libgfor_cv_have_float128, [
> -    AC_TRY_LINK([
> -/* no header */
> -],[
> -  typedef _Complex float __attribute__((mode(TC))) __complex128;
> -
> -  __float128 x;
> -  x = __builtin_huge_valq() - 2.e1000Q;
> -
> -  __complex128 z1, z2;
> -  z1 = x;
> -  z2 = 2.Q;
> -
> -  z1 /= z2;
> -  z1 /= 7.Q;
> -],
> -    libgfor_cv_have_float128=yes,
> -    libgfor_cv_have_float128=no)
> -  ])
> +   GCC_TRY_COMPILE_OR_LINK([
> +    typedef _Complex float __attribute__((mode(TC))) __complex128;
> +
> +    __float128 foo (__float128 x)
> +    {
> +
> +     __complex128 z1, z2;
> +
> +     z1 = x;
> +     z2 = x / 7.Q;
> +     z2 /= z1;
> +
> +     return (__float128) z2;
> +    }
> +
> +    __float128 bar (__float128 x)
> +    {
> +      return x * __builtin_huge_valq ();
> +    }
> +  ],[
> +    foo (1.2Q);
> +    bar (1.2Q);
> +  ],[
> +    libgfor_cv_have_float128=yes
> +  ],[
> +    libgfor_cv_have_float128=no
> +])])
>  
>    if test "x$libgfor_cv_have_float128" = xyes; then
>      AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.])


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