This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH] remove broken DFP fp exception support


The support for raising floating point exceptions in the runtime decimal
float support is totally broken.  This patch removes it.  I've got
something else for internal testing support that I'll submit when a bunch
of small DFP patches are out of the way.

This also includes a prototype to shut up a warning, which probably ought
to be in a separate patch.

Tested on powerpc64-linux with --enable-decimal-float.  OK for mainline?

2006-11-15  Janis Johnson  <janis187@us.ibm.com>

decnumber/

	* decLibrary.c (__dec_type_swap): Add prototype.
	(__dfp_enable_traps, dfp_raise): Delete.

gcc/

	* config/dfp-bit.h (CONTEXT_TRAPS, CONTEXT_ERRORS, DFP_RAISE): Delete.
	* config/dfp-bit.c (dfp_unary_op, dfp_binary_op, dfp_compare_op,
	DFP_TO_DFP, INT_TO_DFP, BFP_TO_DFP): Remove calls to DFP_RAISE.

testsuite/

	* gcc.dg/dfp/snan.c: Delete.

Index: libdecnumber/decLibrary.c
===================================================================
--- libdecnumber/decLibrary.c	(revision 118865)
+++ libdecnumber/decLibrary.c	(working copy)
@@ -31,8 +31,7 @@
 extern int isinfd32 (_Decimal32);
 extern int isinfd64 (_Decimal64);
 extern int isinfd128 (_Decimal128);
-extern void __dfp_enable_traps (void);
-extern void __dfp_raise (int exception __attribute__ ((unused)));
+uint32_t __dec_byte_swap (uint32_t);
 
 int
 isinfd32 (_Decimal32 arg)
@@ -67,20 +66,6 @@
   return (decNumberIsInfinite (&dn));
 }
 
-int __dfp_traps;
-
-void
-__dfp_enable_traps (void)
-{
-  __dfp_traps = 1;
-}
-
-void
-__dfp_raise (int exception __attribute__ ((unused)))
-{
-  raise (SIGFPE);
-}
-
 uint32_t
 __dec_byte_swap (uint32_t in)
 {
Index: gcc/config/dfp-bit.h
===================================================================
--- gcc/config/dfp-bit.h	(revision 118865)
+++ gcc/config/dfp-bit.h	(working copy)
@@ -118,12 +118,6 @@
 extern enum rounding	__decGetRound (void);
 #define CONTEXT_ROUND	__decGetRound ()
 
-extern int __dfp_traps;
-#define CONTEXT_TRAPS	__dfp_traps
-#define CONTEXT_ERRORS(context)	context.status & DEC_Errors
-extern void __dfp_raise (int);
-#define DFP_RAISE(A)	__dfp_raise(A)
-
 /* Conversions between different decimal float types use WIDTH_TO to
    determine additional macros to define.  */
 
Index: gcc/config/dfp-bit.c
===================================================================
--- gcc/config/dfp-bit.c	(revision 118865)
+++ gcc/config/dfp-bit.c	(working copy)
@@ -88,9 +88,6 @@
   /* Perform the operation.  */
   op (&res, &arg1, &context);
 
-  if (CONTEXT_TRAPS && CONTEXT_ERRORS (context))
-    DFP_RAISE (0);
-
   TO_ENCODED (&encoded_result, &res, &context);
   IEEE_TO_HOST (encoded_result, &result);
   return result;
@@ -118,9 +115,6 @@
   /* Perform the operation.  */
   op (&res, &arg1, &arg2, &context);
 
-  if (CONTEXT_TRAPS && CONTEXT_ERRORS (context))
-    DFP_RAISE (0);
-
   TO_ENCODED (&encoded_result, &res, &context);
   IEEE_TO_HOST (encoded_result, &result);
   return result;
@@ -148,9 +142,6 @@
   /* Perform the comparison.  */
   op (&res, &arg1, &arg2, &context);
 
-  if (CONTEXT_TRAPS && CONTEXT_ERRORS (context))
-    DFP_RAISE (0);
-
   if (decNumberIsNegative (&res))
     result = -1;
   else if (decNumberIsZero (&res))
@@ -379,8 +370,6 @@
   HOST_TO_IEEE (f_from, &s_from);
   TO_INTERNAL (&s_from, &d);
   TO_ENCODED_TO (&s_to, &d, &context);
-  if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0)
-    DFP_RAISE (DEC_Inexact);
 
   IEEE_TO_HOST_TO (s_to, &f_to);
   return f_to;
@@ -469,8 +458,6 @@
   /* Convert from the floating point string to a decimal* type.  */
   FROM_STRING (&s, buf, &context);
   IEEE_TO_HOST (s, &f);
-  if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0)
-    DFP_RAISE (DEC_Inexact);
   return f;
 }
 #endif
@@ -519,8 +506,6 @@
   /* Convert from the floating point string to a decimal* type.  */
   FROM_STRING (&s, buf, &context);
   IEEE_TO_HOST (s, &f);
-  if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0)
-    DFP_RAISE (DEC_Inexact);
   return f;
 }
 #endif


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