]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
soft-fp: fix negation NaN handling (bug 16034).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 10 Oct 2013 11:38:56 +0000 (11:38 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 10 Oct 2013 11:38:56 +0000 (11:38 +0000)
ChangeLog
NEWS
soft-fp/negdf2.c
soft-fp/negsf2.c
soft-fp/negtf2.c
soft-fp/op-common.h
sysdeps/sparc/sparc32/soft-fp/q_neg.c

index 00ba832291cb082d75743eff8ec0130b0845b22e..7367bab60ed4ec8b75c351662428782b18329c76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-10-10  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #16034]
+       * soft-fp/op-common.h (_FP_NEG): Document input as raw.  Do not
+       copy class of input value.
+       * soft-fp/negdf2.c (__negdf2): Use raw unpacking and packing.  Do
+       not handle exceptions.
+       * soft-fp/negsf2.c (__negsf2): Likewise.
+       * soft-fp/negtf2.c (__negtf2): Likewise.
+       * sysdeps/sparc/sparc32/soft-fp/q_neg.c (_Q_neg): Likewise.
+
 2013-10-09  Joseph Myers  <joseph@codesourcery.com>
 
        * soft-fp/op-4.h (_FP_FRAC_DISASSEMBLE_4): Remove trailing
diff --git a/NEWS b/NEWS
index 73fa9fe23d7bae4e2c535e20fe89b941be4ab8d3..5f0a710503b06c893275301b85d3c82dab2565ff 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ Version 2.19
   15734, 15735, 15736, 15748, 15749, 15754, 15760, 15797, 15844, 15849,
   15855, 15856, 15857, 15859, 15867, 15886, 15887, 15890, 15892, 15893,
   15895, 15897, 15905, 15909, 15919, 15921, 15923, 15939, 15963, 15966,
-  15988.
+  15988, 16034.
 
 * CVE-2012-4412 The strcoll implementation caches indices and rules for
   large collation sequences to optimize multiple passes.  This cache
index 3cc6f5f400b5d36860c2bb81147d8de72f06757d..1dedc715dd02465d4ce5fa213cc29086b8f4a2e9 100644 (file)
 
 DFtype __negdf2(DFtype a)
 {
-  FP_DECL_EX;
   FP_DECL_D(A); FP_DECL_D(R);
   DFtype r;
 
-  FP_UNPACK_D(A, a);
+  FP_UNPACK_RAW_D(A, a);
   FP_NEG_D(R, A);
-  FP_PACK_D(r, R);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
+  FP_PACK_RAW_D(r, R);
 
   return r;
 }
index d8d5910603675fcf945d9ea27e5b3f99bd48d29d..35ece56fc4caff88191e487baa51d52e79738a29 100644 (file)
 
 SFtype __negsf2(SFtype a)
 {
-  FP_DECL_EX;
   FP_DECL_S(A); FP_DECL_S(R);
   SFtype r;
 
-  FP_UNPACK_S(A, a);
+  FP_UNPACK_RAW_S(A, a);
   FP_NEG_S(R, A);
-  FP_PACK_S(r, R);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
+  FP_PACK_RAW_S(r, R);
 
   return r;
 }
index 1c08441487b68399a7e2f487146f12155cca6735..f51a621611864a2392c39c747a9eb3856afa55b8 100644 (file)
 
 TFtype __negtf2(TFtype a)
 {
-  FP_DECL_EX;
   FP_DECL_Q(A); FP_DECL_Q(R);
   TFtype r;
 
-  FP_UNPACK_Q(A, a);
+  FP_UNPACK_RAW_Q(A, a);
   FP_NEG_Q(R, A);
-  FP_PACK_Q(r, R);
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
+  FP_PACK_RAW_Q(r, R);
 
   return r;
 }
index 75ea352bc77fc50ff2a4bb09ca8157c3155f99f7..5dfb73c18538925b3185c69db4c7fd43418fe61e 100644 (file)
@@ -771,14 +771,12 @@ do {                                                                       \
 
 
 /*
- * Main negation routine.  FIXME -- when we care about setting exception
- * bits reliably, this will not do.  We should examine all of the fp classes.
+ * Main negation routine.  The input value is raw.
  */
 
 #define _FP_NEG(fs, wc, R, X)          \
   do {                                 \
     _FP_FRAC_COPY_##wc(R, X);          \
-    R##_c = X##_c;                     \
     R##_e = X##_e;                     \
     R##_s = 1 ^ X##_s;                 \
   } while (0)
index 551c40887bb2258ea5a7193d2a10a82042a9abe2..5e2449c916f5edd011c80d91d2b76a6bcfaa5fea 100644 (file)
@@ -24,7 +24,6 @@
 
 long double _Q_neg(const long double a)
 {
-  FP_DECL_EX;
   long double c = a;
 
 #if (__BYTE_ORDER == __BIG_ENDIAN)
@@ -36,11 +35,9 @@ long double _Q_neg(const long double a)
 #else
   FP_DECL_Q(A); FP_DECL_Q(C);
 
-  FP_UNPACK_Q(A, a);
+  FP_UNPACK_RAW_Q(A, a);
   FP_NEG_Q(C, A);
-  FP_PACK_Q(c, C);
+  FP_PACK_RAW_Q(c, C);
 #endif
-  FP_CLEAR_EXCEPTIONS;
-  FP_HANDLE_EXCEPTIONS;
   return c;
 }