Skip to content

Commit

Permalink
Properly set or clear expression lookaside for binary expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Oct 20, 2002
1 parent 555017b commit fbee1b4
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tgt-vvp/eval_expr.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_expr.c,v 1.81 2002/09/27 20:24:42 steve Exp $"
#ident "$Id: eval_expr.c,v 1.82 2002/10/20 02:55:37 steve Exp $"
#endif

# include "vvp_priv.h"
Expand Down Expand Up @@ -842,6 +842,7 @@ static struct vector_info draw_binary_expr(ivl_expr_t exp,
int stuff_ok_flag)
{
struct vector_info rv;
int stuff_ok_used_flag = 0;

switch (ivl_expr_opcode(exp)) {
case 'a': /* && (logical and) */
Expand All @@ -853,13 +854,15 @@ static struct vector_info draw_binary_expr(ivl_expr_t exp,
case 'N': /* !== */
case 'n': /* != */
rv = draw_binary_expr_eq(exp, wid, stuff_ok_flag);
stuff_ok_used_flag = 1;
break;

case '<':
case '>':
case 'L': /* <= */
case 'G': /* >= */
rv = draw_binary_expr_le(exp, wid, stuff_ok_flag);
stuff_ok_used_flag = 1;
break;

case '+':
Expand Down Expand Up @@ -894,8 +897,21 @@ static struct vector_info draw_binary_expr(ivl_expr_t exp,
assert(0);
}

if ((rv.base >= 8) && (! stuff_ok_flag))
save_expression_lookaside(rv.base, exp, wid);
/* Mark in the lookaside that this value is done. If any OK
flags besides the STUFF_OK_47 flag are set, then the result
may not be a pure one, so clear the lookaside for the range
instead of setting in to the new expression result.
The stuff_ok_used_flag tells me if the stuff_ok_flag was
even used by anything. If not, then I can ignore it in the
following logic. */
if (rv.base >= 8) {
if (stuff_ok_used_flag && (stuff_ok_flag & ~STUFF_OK_47))
save_expression_lookaside(rv.base, 0, wid);
else
save_expression_lookaside(rv.base, exp, wid);
}

return rv;
}

Expand Down Expand Up @@ -1852,6 +1868,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp, int stuff_ok_flag)

/*
* $Log: eval_expr.c,v $
* Revision 1.82 2002/10/20 02:55:37 steve
* Properly set or clear expression lookaside for binary expressions.
*
* Revision 1.81 2002/09/27 20:24:42 steve
* Allow expression lookaside map to spam statements.
*
Expand Down

0 comments on commit fbee1b4

Please sign in to comment.