]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[BZ #376]
authorUlrich Drepper <drepper@redhat.com>
Sun, 26 Sep 2004 10:11:59 +0000 (10:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 26 Sep 2004 10:11:59 +0000 (10:11 +0000)
Update.
* sysdeps/generic/s_fdim.c: Handle +inf/+inf
* sysdeps/generic/s_fdimf.c: Likewise.
* sysdeps/generic/s_fdiml.c: Likewise.
* sysdeps/i386/i686/fpu/s_fdim.S: Likewise.
* sysdeps/i386/i686/fpu/s_fdimf.S: Likewise.
* sysdeps/i386/i686/fpu/s_fdiml.S: Likewise.
* sysdeps/powerpc/fpu/s_fdim.c: Likewise.
* sysdeps/powerpc/fpu/s_fdimf.c: Likewise.
* sysdeps/x86_64/fpu/s_fdiml.S: Likewise.
* math/libm-test.inc (fdim_test): Add test case.  [BZ #376].

ChangeLog
math/libm-test.inc
sysdeps/generic/s_fdim.c
sysdeps/generic/s_fdimf.c
sysdeps/generic/s_fdiml.c
sysdeps/i386/i686/fpu/s_fdim.S
sysdeps/i386/i686/fpu/s_fdimf.S
sysdeps/i386/i686/fpu/s_fdiml.S
sysdeps/powerpc/fpu/s_fdim.c
sysdeps/powerpc/fpu/s_fdimf.c
sysdeps/x86_64/fpu/s_fdiml.S

index f9387143e844e5a7a80982e0f7b373343274e6f1..91a59dab054dbadb32f8729fca72a2ef00c08ce4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2004-09-26  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/generic/s_fdim.c: Handle +inf/+inf
+       * sysdeps/generic/s_fdimf.c: Likewise.
+       * sysdeps/generic/s_fdiml.c: Likewise.
+       * sysdeps/i386/i686/fpu/s_fdim.S: Likewise.
+       * sysdeps/i386/i686/fpu/s_fdimf.S: Likewise.
+       * sysdeps/i386/i686/fpu/s_fdiml.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fdim.c: Likewise.
+       * sysdeps/powerpc/fpu/s_fdimf.c: Likewise.
+       * sysdeps/x86_64/fpu/s_fdiml.S: Likewise.
+       * math/libm-test.inc (fdim_test): Add test case.  [BZ #376].
+
        * sysdeps/generic/bits/types.h: Fix __SQUAD_TYPE and __UQUAD_TYPE
        for compilers without __GLIBC_HAVE_LONG_LONG.  [BZ #362]
 
index 729fce936993073b69bf0926f01630a3b362115c..b23ec8430fe6d9e31bfd18a7fed9e89374cd889e 100644 (file)
@@ -2557,6 +2557,8 @@ fdim_test (void)
   TEST_ff_f (fdim, nan_value, minus_infty, nan_value);
   TEST_ff_f (fdim, nan_value, nan_value, nan_value);
 
+  TEST_ff_f (fdim, plus_infty, plus_infty, 0);
+
   END (fdim);
 }
 
index 201f93692ec6de3a399468e27792b7dc1787129d..5804e631c376f83bb84d5dba0a7bd34adee463d2 100644 (file)
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -31,7 +31,7 @@ __fdim (double x, double y)
     /* Raise invalid flag.  */
     return x - y;
 
-  return x < y ? 0 : x - y;
+  return x <= y ? 0 : x - y;
 }
 weak_alias (__fdim, fdim)
 #ifdef NO_LONG_DOUBLE
index 64d54b7fe4c30ee3cc066e1c64c5d1b2b2a58325..2f3ce303ae869b6c0b093402fd9065039cfd5bb0 100644 (file)
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -31,6 +31,6 @@ __fdimf (float x, float y)
     /* Raise invalid flag.  */
     return x - y;
 
-  return x < y ? 0 : x - y;
+  return x <= y ? 0 : x - y;
 }
 weak_alias (__fdimf, fdimf)
index 83049ae732d89dcdcf80e83806f1a7cf6efced95..70246bafbdb66f2253f03f4c1230226133957aa6 100644 (file)
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -31,6 +31,6 @@ __fdiml (long double x, long double y)
     /* Raise invalid flag.  */
     return x - y;
 
-  return x < y ? 0 : x - y;
+  return x <= y ? 0 : x - y;
 }
 weak_alias (__fdiml, fdiml)
index e610973a566063eda9ce939598d9dcb20d302f8c..30ecff4e7c4226d3aa957dec06b813f21dc37ff5 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute positive difference.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -28,12 +28,14 @@ ENTRY(__fdim)
        fucomi  %st(1), %st
        jp      1f
 
-       fsubrp  %st, %st(1)
+       jc      3f
+       fstp    %st(1)
        fldz
-       fcomi   %st(1), %st
-       fcmovb  %st(1), %st
        jmp     2f
 
+3:     fsubrp  %st, %st(1)
+       ret
+
 1:     fucomi  %st(0), %st
        fcmovnu %st(1), %st
 2:     fstp    %st(1)
index a22cbe9d6634e6570653023816f1f6f4153012c2..888df14b6f1f810e7bbd9b53823403c27e4acb0a 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute positive difference.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -28,12 +28,14 @@ ENTRY(__fdimf)
        fucomi  %st(1), %st
        jp      1f
 
-       fsubrp  %st, %st(1)
+       jc      3f
+       fstp    %st(1)
        fldz
-       fcomi   %st(1), %st
-       fcmovb  %st(1), %st
        jmp     2f
 
+3:     fsubrp  %st, %st(1)
+       ret
+
 1:     fucomi  %st(0), %st
        fcmovnu %st(1), %st
 2:     fstp    %st(1)
index fa3c51e4626272c4c6a4c7dd755f4540fada1071..cb0e26e36771434a856ed449b75dc6f006b5b446 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute positive difference.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -28,12 +28,14 @@ ENTRY(__fdiml)
        fucomi  %st(1), %st
        jp      1f
 
-       fsubrp  %st, %st(1)
+       jc      3f
+       fstp    %st(1)
        fldz
-       fcomi   %st(1), %st
-       fcmovb  %st(1), %st
        jmp     2f
 
+3:     fsubrp  %st, %st(1)
+       ret
+
 1:     fucomi  %st(0), %st
        fcmovnu %st(1), %st
 2:     fstp    %st(1)
index 165e2ff5a5c218abad8f70cc452e3b7b2e737b78..2b767addabe4e7a730824a34b33987ad79b9cf1b 100644 (file)
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
 double
 __fdim (double x, double y)
 {
-  return x < y ? 0 : x - y;
+  return x <= y ? 0 : x - y;
 }
 weak_alias (__fdim, fdim)
 #ifdef NO_LONG_DOUBLE
index 997ec8983f33a4dac13378f49987027e0514c015..a27c1e4039ffdd0690bb5e0a9d509042942bf1b5 100644 (file)
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,6 @@
 float
 __fdimf (float x, float y)
 {
-  return x < y ? 0 : x - y;
+  return x <= y ? 0 : x - y;
 }
 weak_alias (__fdimf, fdimf)
index 3460b0f979edfb7e53845597ee63143a6d9a1803..d63ca00ef1837fd057814b4b248a10ee00e1d27d 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute positive difference.
-   Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -28,12 +28,14 @@ ENTRY(__fdiml)
        fucomi  %st(1), %st
        jp      1f
 
-       fsubrp  %st, %st(1)
+       jc      3f
+       fstp    %st(1)
        fldz
-       fcomi   %st(1), %st
-       fcmovb  %st(1), %st
        jmp     2f
 
+3:     fsubrp  %st, %st(1)
+       ret
+
 1:     fucomi  %st(0), %st
        fcmovnu %st(1), %st
 2:     fstp    %st(1)