[PATCH, soft-fp]: Do not handle cleared exceptions in __neg_f2() functions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH, soft-fp]: Do not handle cleared exceptions in __neg_f2() functions

Uros Bizjak-3
Hello!

There is no need to handle exceptions __neg_f2() soft-fp functions as
they are cleared in previous line.
The patch was tested by bootstrapping gcc for x86_64 target (soft-fp is
shared between gcc and libc).

Also, please note that soft-fp/extended.h is not used anywhere in glibc
and could just be removed.

2007-05-19  Uros Bizjak  <[hidden email]>

        * soft-fp/negsf2.c: Do not handle cleared exceptions.
        * soft-fp/negdf2.c: Ditto.
        * soft-fp/negtf2.c: Ditto.
        * soft-fp/extended.h: Remove.

Uros.

Index: negdf2.c
===================================================================
--- negdf2.c (revision 124853)
+++ negdf2.c (working copy)
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Return -a
-   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   Copyright (C) 1997,1999,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson ([hidden email]) and
   Jakub Jelinek ([hidden email]).
@@ -42,7 +42,6 @@
   FP_NEG_D(R, A);
   FP_PACK_D(r, R);
   FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
 
   return r;
 }
Index: negsf2.c
===================================================================
--- negsf2.c (revision 124853)
+++ negsf2.c (working copy)
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Return -a
-   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   Copyright (C) 1997,1999,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson ([hidden email]) and
   Jakub Jelinek ([hidden email]).
@@ -42,7 +42,6 @@
   FP_NEG_S(R, A);
   FP_PACK_S(r, R);
   FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
 
   return r;
 }
Index: negtf2.c
===================================================================
--- negtf2.c (revision 124853)
+++ negtf2.c (working copy)
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Return -a
-   Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
+   Copyright (C) 1997,1999,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson ([hidden email]) and
   Jakub Jelinek ([hidden email]).
@@ -42,7 +42,6 @@
   FP_NEG_Q(R, A);
   FP_PACK_Q(r, R);
   FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
 
   return r;
 }
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH, soft-fp]: Do not handle cleared exceptions in __neg_f2() functions

Jakub Jelinek
On Sat, May 19, 2007 at 03:34:03PM +0200, Uros Bizjak wrote:
> There is no need to handle exceptions __neg_f2() soft-fp functions as
> they are cleared in previous line.

That's wrong, please read sysdeps/sparc{32,64}/soft-fp/sfp-machine.h's
FP_HANDLE_EXCEPTIONS and SPARC ISA manuals about the cexc field.
Even FP_CLEAR_EXCEPTIONS; FP_HANDLE_EXCEPTIONS; does something on SPARC.

        Jakub