Handle x case of unary ! properly.

This commit is contained in:
steve 2002-05-07 03:49:58 +00:00
parent a3eb6868ea
commit e70e04d6e8
1 changed files with 18 additions and 9 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: eval_expr.c,v 1.58 2002/04/22 02:41:30 steve Exp $" #ident "$Id: eval_expr.c,v 1.59 2002/05/07 03:49:58 steve Exp $"
#endif #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -1351,14 +1351,20 @@ static struct vector_info draw_unary_expr(ivl_expr_t exp, unsigned wid)
res.base, res.base, res.wid); res.base, res.base, res.wid);
clr_vector(tmp); clr_vector(tmp);
res.wid = 1; res.wid = 1;
} else { } else switch (res.base) {
unsigned label_out = local_count++; case 0:
fprintf(vvp_out, " %%mov 4, %u, 1;\n", res.base); res.base = 1;
fprintf(vvp_out, " %%mov %u, 1, 1;\n", res.base); break;
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 4;\n", case 1:
thread_count, label_out); res.base = 0;
fprintf(vvp_out, " %%mov %u, 0, 1;\n", res.base); break;
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, label_out); case 2:
case 3:
res.base = 2;
break;
default:
fprintf(vvp_out, " %%inv %u, 1;\n", res.base);
break;
} }
/* If the result needs to be bigger then the calculated /* If the result needs to be bigger then the calculated
@ -1506,6 +1512,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp)
/* /*
* $Log: eval_expr.c,v $ * $Log: eval_expr.c,v $
* Revision 1.59 2002/05/07 03:49:58 steve
* Handle x case of unary ! properly.
*
* Revision 1.58 2002/04/22 02:41:30 steve * Revision 1.58 2002/04/22 02:41:30 steve
* Reduce the while loop expression if needed. * Reduce the while loop expression if needed.
* *