Author: zhuqing
Date: 2011-10-12 01:33:39 -0400 (Wed, 12 Oct 2011)
New Revision: 3759
Modified:
trunk/osprey/be/opt/opt_vn_expr.cxx
trunk/osprey/common/com/MIPS/targ_const.cxx
trunk/osprey/common/com/NVISA/targ_const.cxx
trunk/osprey/common/com/SL/targ_const.cxx
trunk/osprey/common/com/ia64/targ_const.cxx
trunk/osprey/common/com/loongson/targ_const.cxx
trunk/osprey/common/com/ppc32/targ_const.cxx
trunk/osprey/common/com/targ_const.h
trunk/osprey/common/com/x8664/targ_const.cxx
Log:
Fix bug880.
Fix open64 build failure caused by r3753.
Code Review: Gilmore, Doug
Modified: trunk/osprey/be/opt/opt_vn_expr.cxx
===================================================================
--- trunk/osprey/be/opt/opt_vn_expr.cxx 2011-10-12 03:27:39 UTC (rev 3758)
+++ trunk/osprey/be/opt/opt_vn_expr.cxx 2011-10-12 05:33:39 UTC (rev 3759)
@@ -645,15 +645,10 @@
// fix bug 2691: when both are floating-point zero, use integer
// comparison so +0 and -0 will be regarded as different for value
// numbering purpose
- else if (this_mty == MTYPE_F8 &&
- TCON_R8(other_tcon) == 0 && TCON_R8(_tcon) == 0)
- truth = TCON_v1(other_tcon) == TCON_v1(_tcon);
- else if (this_mty == MTYPE_F4 &&
- TCON_R4(other_tcon) == 0 && TCON_R4(_tcon) == 0)
- truth = TCON_word0(other_tcon) == TCON_word0(_tcon);
- else if (this_mty == MTYPE_F10 &&
- TCON_R10(other_tcon) == 0 && TCON_R10(_tcon) == 0)
- truth = TCON_v2(other_tcon) == TCON_v2(_tcon);
+ else if (Targ_Is_Zero(other_tcon))
+ truth = Targ_Is_Zero(_tcon);
+ else if (Targ_Is_Neg_Zero(other_tcon))
+ truth = Targ_Is_Neg_Zero(_tcon);
#endif
else {
BOOL folded;
Modified: trunk/osprey/common/com/MIPS/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/MIPS/targ_const.cxx 2011-10-12 03:27:39 UTC (rev
3758)
+++ trunk/osprey/common/com/MIPS/targ_const.cxx 2011-10-12 05:33:39 UTC (rev
3759)
@@ -4636,6 +4636,23 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/NVISA/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/NVISA/targ_const.cxx 2011-10-12 03:27:39 UTC
(rev 3758)
+++ trunk/osprey/common/com/NVISA/targ_const.cxx 2011-10-12 05:33:39 UTC
(rev 3759)
@@ -4902,6 +4902,23 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/SL/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/SL/targ_const.cxx 2011-10-12 03:27:39 UTC (rev
3758)
+++ trunk/osprey/common/com/SL/targ_const.cxx 2011-10-12 05:33:39 UTC (rev
3759)
@@ -4640,6 +4640,23 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/ia64/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/ia64/targ_const.cxx 2011-10-12 03:27:39 UTC (rev
3758)
+++ trunk/osprey/common/com/ia64/targ_const.cxx 2011-10-12 05:33:39 UTC (rev
3759)
@@ -5152,6 +5152,26 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ case MTYPE_F10:
+ return (TCON_R16(t) == 0.0 &&
+ (TCON_v0(t)|TCON_v1(t)|TCON_v2(t)|TCON_v3(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/loongson/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/loongson/targ_const.cxx 2011-10-12 03:27:39 UTC
(rev 3758)
+++ trunk/osprey/common/com/loongson/targ_const.cxx 2011-10-12 05:33:39 UTC
(rev 3759)
@@ -4861,6 +4861,23 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/ppc32/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/ppc32/targ_const.cxx 2011-10-12 03:27:39 UTC
(rev 3758)
+++ trunk/osprey/common/com/ppc32/targ_const.cxx 2011-10-12 05:33:39 UTC
(rev 3759)
@@ -5104,6 +5104,26 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ case MTYPE_F10:
+ return (TCON_R16(t) == 0.0 &&
+ (TCON_v0(t)|TCON_v1(t)|TCON_v2(t)|TCON_v3(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
Modified: trunk/osprey/common/com/targ_const.h
===================================================================
--- trunk/osprey/common/com/targ_const.h 2011-10-12 03:27:39 UTC (rev
3758)
+++ trunk/osprey/common/com/targ_const.h 2011-10-12 05:33:39 UTC (rev
3759)
@@ -482,6 +482,7 @@
/* Is the given constant a zero? */
extern BOOL Targ_Is_Zero ( TCON t );
+extern BOOL Targ_Is_Neg_Zero ( TCON t );
/* Determine whether a TCON represents an integral value, and if so
* return its value in *iv:
Modified: trunk/osprey/common/com/x8664/targ_const.cxx
===================================================================
--- trunk/osprey/common/com/x8664/targ_const.cxx 2011-10-12 03:27:39 UTC
(rev 3758)
+++ trunk/osprey/common/com/x8664/targ_const.cxx 2011-10-12 05:33:39 UTC
(rev 3759)
@@ -5730,6 +5730,26 @@
}
return FALSE;
} /* Targ_Is_Zero */
+
+/*----------------------------------------------------------------------------
+ * return TRUE if the target representation of this TCON is negative zero
+ *--------------------------------------------------------------------------*/
+BOOL Targ_Is_Neg_Zero ( TCON t )
+{
+ switch (TCON_ty(t)) {
+ case MTYPE_F4:
+ return (TCON_R4(t) == 0.0 && TCON_v0(t) != 0);
+ case MTYPE_F8:
+ return (TCON_R8(t) == 0.0
+ && (TCON_v0(t)|TCON_v1(t)) != 0);
+ case MTYPE_F10:
+ return (TCON_R10(t) == 0.0 &&
+ (TCON_v0(t)|TCON_v1(t)|TCON_v2(t)|TCON_v3(t)) != 0);
+ default:
+ return FALSE;
+ }
+}
+
/* ====================================================================
*
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel