]> sourceware.org Git - newlib-cygwin.git/commitdiff
2009-04-17 Ken Werner <ken.werner@de.ibm.com>
authorJeff Johnston <jjohnstn@redhat.com>
Fri, 17 Apr 2009 20:54:19 +0000 (20:54 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Fri, 17 Apr 2009 20:54:19 +0000 (20:54 +0000)
        * libc/include/machine/ieeefp.h: _LDBL_EQ_DBL check fixed.
        * libc/include/math.h (llrintl): Declare.
        * libm/common/llrintl.c: New File.
        * libm/common/Makefile.am: New File added.
        * libm/common/Makefile.in: Regenerate.

newlib/ChangeLog
newlib/libc/include/machine/ieeefp.h
newlib/libc/include/math.h
newlib/libm/common/Makefile.am
newlib/libm/common/Makefile.in
newlib/libm/common/llrintl.c [new file with mode: 0644]

index c289084eea6505fa02f5c806c0f842bc419a5492..a974daa91fb9b7ebf30efecd55f74b573bc5e6d0 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-17  Ken Werner  <ken.werner@de.ibm.com>
+
+       * libc/include/machine/ieeefp.h: _LDBL_EQ_DBL check fixed.
+       * libc/include/math.h (llrintl): Declare.
+       * libm/common/llrintl.c: New File.
+       * libm/common/Makefile.am: New File added.
+       * libm/common/Makefile.in: Regenerate.
+
 2009-04-17  Ken Werner  <ken.werner@de.ibm.com>
 
        * libc/configure.in: Change AC_TRY_COMPILE to AC_TRY_COMMAND to
index bbbec5473f6503be5816cc54170a0946456acf74..643111beb54153b49f7c4ddc7aa78850704ff64b 100644 (file)
 
 /* Check if long double is as wide as double. */
 #if (!defined(__STRICT_ANSI__) || __STDC_VERSION__ > 199901L || \
-  defined(__cplusplus)) && defined(LDBL_MANT_DIG) && \
-    (DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
-    LDBL_MAX_EXP == DBL_MAX_EXP)
+  defined(__cplusplus)) && defined(__LDBL_MANT_DIG__) && \
+    (__DBL_MANT_DIG__ == __LDBL_MANT_DIG__ && __LDBL_MIN_EXP__ == __DBL_MIN_EXP__ && \
+    __LDBL_MAX_EXP__ == __DBL_MAX_EXP__)
  #define _LDBL_EQ_DBL
 #endif
index 95f0e216b43338018e266c9fd77d21ae37fb04b6..6f61583a4f852ef3ded378d5f78a70d3cce17a85 100644 (file)
@@ -382,6 +382,7 @@ extern long double scalblnl _PARAMS((long double, long));
 extern long double tgammal _PARAMS((long double));
 extern long double nearbyintl _PARAMS((long double));
 extern long int lrintl _PARAMS((long double));
+extern long long int llrintl _PARAMS((long double));
 extern long double roundl _PARAMS((long double));
 extern long lroundl _PARAMS((long double));
 extern _LONG_LONG_TYPE int llroundl _PARAMS((long double));
index b7dab9a3fa00ffcf79e7d05224250b54b32b8624..ed556ef1d9b6ce8e869cffe40a0b3e537038b444 100644 (file)
@@ -28,9 +28,9 @@ lsrc =        atanl.c cosl.c sinl.c tanl.c tanhl.c frexpl.c modfl.c ceill.c fabsl.c \
        floorl.c log1pl.c expm1l.c acosl.c asinl.c atan2l.c coshl.c sinhl.c \
        expl.c ldexpl.c logl.c log10l.c powl.c sqrtl.c fmodl.c hypotl.c \
        copysignl.c nanl.c ilogbl.c asinhl.c cbrtl.c nextafterl.c rintl.c \
-       scalbnl.c exp2l.c scalblnl.c tgammal.c nearbyintl.c lrintl.c roundl.c \
-       lroundl.c llroundl.c truncl.c remquol.c fdiml.c fmaxl.c fminl.c fmal.c \
-       acoshl.c atanhl.c remainderl.c lgammal.c erfl.c erfcl.c
+       scalbnl.c exp2l.c scalblnl.c tgammal.c nearbyintl.c lrintl.c llrintl.c \
+       roundl.c lroundl.c llroundl.c truncl.c remquol.c fdiml.c fmaxl.c fminl.c \
+       fmal.c acoshl.c atanhl.c remainderl.c lgammal.c erfl.c erfcl.c
 
 libcommon_la_LDFLAGS = -Xcompiler -nostdlib
 
index 6620948df5c2fe815a78f22564d8a297ceba207e..d3e6fcc6a7a2a43533869085d93b4e9ff3b2bc20 100644 (file)
@@ -114,14 +114,14 @@ am__objects_3 = lib_a-atanl.$(OBJEXT) lib_a-cosl.$(OBJEXT) \
        lib_a-scalbnl.$(OBJEXT) lib_a-exp2l.$(OBJEXT) \
        lib_a-scalblnl.$(OBJEXT) lib_a-tgammal.$(OBJEXT) \
        lib_a-nearbyintl.$(OBJEXT) lib_a-lrintl.$(OBJEXT) \
-       lib_a-roundl.$(OBJEXT) lib_a-lroundl.$(OBJEXT) \
-       lib_a-llroundl.$(OBJEXT) lib_a-truncl.$(OBJEXT) \
-       lib_a-remquol.$(OBJEXT) lib_a-fdiml.$(OBJEXT) \
-       lib_a-fmaxl.$(OBJEXT) lib_a-fminl.$(OBJEXT) \
-       lib_a-fmal.$(OBJEXT) lib_a-acoshl.$(OBJEXT) \
-       lib_a-atanhl.$(OBJEXT) lib_a-remainderl.$(OBJEXT) \
-       lib_a-lgammal.$(OBJEXT) lib_a-erfl.$(OBJEXT) \
-       lib_a-erfcl.$(OBJEXT)
+       lib_a-llrintl.$(OBJEXT) lib_a-roundl.$(OBJEXT) \
+       lib_a-lroundl.$(OBJEXT) lib_a-llroundl.$(OBJEXT) \
+       lib_a-truncl.$(OBJEXT) lib_a-remquol.$(OBJEXT) \
+       lib_a-fdiml.$(OBJEXT) lib_a-fmaxl.$(OBJEXT) \
+       lib_a-fminl.$(OBJEXT) lib_a-fmal.$(OBJEXT) \
+       lib_a-acoshl.$(OBJEXT) lib_a-atanhl.$(OBJEXT) \
+       lib_a-remainderl.$(OBJEXT) lib_a-lgammal.$(OBJEXT) \
+       lib_a-erfl.$(OBJEXT) lib_a-erfcl.$(OBJEXT)
 @HAVE_LONG_DOUBLE_TRUE@@USE_LIBTOOL_FALSE@am__objects_4 =  \
 @HAVE_LONG_DOUBLE_TRUE@@USE_LIBTOOL_FALSE@     $(am__objects_3)
 @USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
@@ -151,10 +151,10 @@ am__objects_7 = atanl.lo cosl.lo sinl.lo tanl.lo tanhl.lo frexpl.lo \
        ldexpl.lo logl.lo log10l.lo powl.lo sqrtl.lo fmodl.lo \
        hypotl.lo copysignl.lo nanl.lo ilogbl.lo asinhl.lo cbrtl.lo \
        nextafterl.lo rintl.lo scalbnl.lo exp2l.lo scalblnl.lo \
-       tgammal.lo nearbyintl.lo lrintl.lo roundl.lo lroundl.lo \
-       llroundl.lo truncl.lo remquol.lo fdiml.lo fmaxl.lo fminl.lo \
-       fmal.lo acoshl.lo atanhl.lo remainderl.lo lgammal.lo erfl.lo \
-       erfcl.lo
+       tgammal.lo nearbyintl.lo lrintl.lo llrintl.lo roundl.lo \
+       lroundl.lo llroundl.lo truncl.lo remquol.lo fdiml.lo fmaxl.lo \
+       fminl.lo fmal.lo acoshl.lo atanhl.lo remainderl.lo lgammal.lo \
+       erfl.lo erfcl.lo
 @HAVE_LONG_DOUBLE_TRUE@@USE_LIBTOOL_TRUE@am__objects_8 =  \
 @HAVE_LONG_DOUBLE_TRUE@@USE_LIBTOOL_TRUE@      $(am__objects_7)
 @USE_LIBTOOL_TRUE@am_libcommon_la_OBJECTS = $(am__objects_5) \
@@ -346,9 +346,9 @@ lsrc = atanl.c cosl.c sinl.c tanl.c tanhl.c frexpl.c modfl.c ceill.c fabsl.c \
        floorl.c log1pl.c expm1l.c acosl.c asinl.c atan2l.c coshl.c sinhl.c \
        expl.c ldexpl.c logl.c log10l.c powl.c sqrtl.c fmodl.c hypotl.c \
        copysignl.c nanl.c ilogbl.c asinhl.c cbrtl.c nextafterl.c rintl.c \
-       scalbnl.c exp2l.c scalblnl.c tgammal.c nearbyintl.c lrintl.c roundl.c \
-       lroundl.c llroundl.c truncl.c remquol.c fdiml.c fmaxl.c fminl.c fmal.c \
-       acoshl.c atanhl.c remainderl.c lgammal.c erfl.c erfcl.c
+       scalbnl.c exp2l.c scalblnl.c tgammal.c nearbyintl.c lrintl.c llrintl.c \
+       roundl.c lroundl.c llroundl.c truncl.c remquol.c fdiml.c fmaxl.c fminl.c \
+       fmal.c acoshl.c atanhl.c remainderl.c lgammal.c erfl.c erfcl.c
 
 libcommon_la_LDFLAGS = -Xcompiler -nostdlib
 @USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libcommon.la
@@ -1098,6 +1098,12 @@ lib_a-lrintl.o: lrintl.c
 lib_a-lrintl.obj: lrintl.c
        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lrintl.obj `if test -f 'lrintl.c'; then $(CYGPATH_W) 'lrintl.c'; else $(CYGPATH_W) '$(srcdir)/lrintl.c'; fi`
 
+lib_a-llrintl.o: llrintl.c
+       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-llrintl.o `test -f 'llrintl.c' || echo '$(srcdir)/'`llrintl.c
+
+lib_a-llrintl.obj: llrintl.c
+       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-llrintl.obj `if test -f 'llrintl.c'; then $(CYGPATH_W) 'llrintl.c'; else $(CYGPATH_W) '$(srcdir)/llrintl.c'; fi`
+
 lib_a-roundl.o: roundl.c
        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-roundl.o `test -f 'roundl.c' || echo '$(srcdir)/'`roundl.c
 
diff --git a/newlib/libm/common/llrintl.c b/newlib/libm/common/llrintl.c
new file mode 100644 (file)
index 0000000..0835def
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+(C) Copyright IBM Corp. 2009
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+* Neither the name of IBM nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <math.h>
+
+/* On platforms where long double is as wide as double.  */
+#ifdef _LDBL_EQ_DBL
+long long int
+llrintl (long double x)
+{
+  return llrint(x);
+}
+#endif
+
This page took 0.0618 seconds and 5 git commands to generate.