darwin-ldouble.c (fmsub): Eliminate the full PACK/UNPACK between FP_SUB_Q and FD_TRUN...
authorSteven Munroe <sjmunroe@us.ibm.com>
Fri, 23 May 2008 14:36:54 +0000 (14:36 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Fri, 23 May 2008 14:36:54 +0000 (14:36 +0000)
* config/rs6000/darwin-ldouble.c (fmsub): Eliminate the full
PACK/UNPACK between FP_SUB_Q and FD_TRUNC so that the result
is only rounded once.

From-SVN: r135815

gcc/ChangeLog
gcc/config/rs6000/darwin-ldouble.c

index eace21cf9b194c367411eaa512918b449e52dcda..cadf9d1370589a829d3609ed5ba100ba78846b9e 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-23  Steven Munroe  <sjmunroe@us.ibm.com>
+
+       * config/rs6000/darwin-ldouble.c (fmsub): Eliminate the full
+       PACK/UNPACK between FP_SUB_Q and FD_TRUNC so that the result
+       is only rounded once.
+
 2008-05-23  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-operands.c (mark_difference_for_renaming): Use
index 7aa15b6d0199df5ac46be3c497aa2872cd6ea532..15cac65c6edde69825e4228616e39d598d55c552 100644 (file)
@@ -422,15 +422,13 @@ fmsub (double a, double b, double c)
     FP_UNPACK_SEMIRAW_Q(U,u);
     FP_UNPACK_SEMIRAW_Q(Z,z);
     FP_SUB_Q(V,U,Z);
-    FP_PACK_SEMIRAW_Q(v,V);
-    FP_HANDLE_EXCEPTIONS;
 
     /* Truncate quad to double.  */
-    FP_INIT_ROUNDMODE;
-    FP_UNPACK_SEMIRAW_Q(V,v);
 #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+    V_f[3] &= 0x0007ffff;
     FP_TRUNC(D,Q,2,4,R,V);
 #else
+    V_f1 &= 0x0007ffffffffffffL;
     FP_TRUNC(D,Q,1,2,R,V);
 #endif
     FP_PACK_SEMIRAW_D(r,R);