[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make use of __builtin_isnanf
From: |
Bruno Haible |
Subject: |
make use of __builtin_isnanf |
Date: |
Sat, 26 Jan 2008 15:29:11 +0100 |
User-agent: |
KMail/1.5.4 |
GCC 4.0 or newer has a built-in for isnanf(). This patch makes use of it
(overriding the libc's isnanf(), since the GCC built-in appears to work
everywhere).
2008-01-26 Bruno Haible <address@hidden>
* m4/isnanf.m4 (gl_HAVE_ISNANF_NO_LIBM, gl_ISNANF_WORKS): Test the
GCC >= 4.0 built-in.
* lib/isnanf.h (isnanf): Use the GCC >= 4.0 built-in.
*** lib/isnanf.h.orig 2008-01-26 13:20:12.000000000 +0100
--- lib/isnanf.h 2008-01-26 13:19:50.000000000 +0100
***************
*** 1,5 ****
/* Test for NaN that does not need libm.
! Copyright (C) 2007 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
--- 1,5 ----
/* Test for NaN that does not need libm.
! Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
***************
*** 17,23 ****
#if HAVE_ISNANF_IN_LIBC
/* Get declaration of isnan macro or (older) isnanf function. */
# include <math.h>
! # ifdef isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
# endif
--- 17,27 ----
#if HAVE_ISNANF_IN_LIBC
/* Get declaration of isnan macro or (older) isnanf function. */
# include <math.h>
! # if __GNUC__ >= 4
! /* GCC 4.0 and newer provides three built-ins for isnan. */
! # undef isnanf
! # define isnanf(x) __builtin_isnanf ((float)(x))
! # elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
# endif
*** m4/isnanf.m4.orig 2008-01-26 13:20:12.000000000 +0100
--- m4/isnanf.m4 2008-01-26 13:19:50.000000000 +0100
***************
*** 1,5 ****
! # isnanf.m4 serial 4
! dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
--- 1,5 ----
! # isnanf.m4 serial 5
! dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
***************
*** 33,39 ****
[gl_cv_func_isnanf_no_libm],
[
AC_TRY_LINK([#include <math.h>
! #ifdef isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif
--- 33,42 ----
[gl_cv_func_isnanf_no_libm],
[
AC_TRY_LINK([#include <math.h>
! #if __GNUC__ >= 4
! # undef isnanf
! # define isnanf(x) __builtin_isnanf ((float)(x))
! #elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif
***************
*** 54,60 ****
[
AC_TRY_RUN([
#include <math.h>
! #ifdef isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif
--- 57,66 ----
[
AC_TRY_RUN([
#include <math.h>
! #if __GNUC__ >= 4
! # undef isnanf
! # define isnanf(x) __builtin_isnanf ((float)(x))
! #elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- make use of __builtin_isnanf,
Bruno Haible <=