Fix compile time eval of signed <= signed.

This commit is contained in:
steve 2002-04-24 02:47:02 +00:00
parent 7e27217dac
commit 714ca3542d
1 changed files with 15 additions and 9 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: eval_tree.cc,v 1.34 2002/04/14 19:28:47 steve Exp $"
#ident "$Id: eval_tree.cc,v 1.35 2002/04/24 02:47:02 steve Exp $"
#endif
# include "config.h"
@ -235,6 +235,7 @@ NetEConst* NetEBComp::eval_leeq_()
return new NetEConst(result);
}
/* Detect the case where the right side is greater that or
equal to the largest value the left side can possibly
have. */
@ -254,14 +255,16 @@ NetEConst* NetEBComp::eval_leeq_()
return new NetEConst(result);
}
if (lv.has_sign() && rv.has_sign() && (lv.as_long() <= rv.as_long())) {
verinum result(verinum::V1, 1);
return new NetEConst(result);
}
if (lv.as_ulong() <= rv.as_ulong()) {
verinum result(verinum::V1, 1);
return new NetEConst(result);
if (lv.has_sign() && rv.has_sign()) {
if (lv.as_long() <= rv.as_long()) {
verinum result(verinum::V1, 1);
return new NetEConst(result);
}
} else {
if (lv.as_ulong() <= rv.as_ulong()) {
verinum result(verinum::V1, 1);
return new NetEConst(result);
}
}
verinum result(verinum::V0, 1);
@ -1065,6 +1068,9 @@ NetEConst* NetEUReduce::eval_tree()
/*
* $Log: eval_tree.cc,v $
* Revision 1.35 2002/04/24 02:47:02 steve
* Fix compile time eval of signed <= signed.
*
* Revision 1.34 2002/04/14 19:28:47 steve
* Fix constant evaluation of unary
*