From 74e2343e52cb0a9863508deaa83fb4bab0cbab55 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 13 Nov 2008 17:21:12 -0800 Subject: [PATCH] V0.8: fix shifting of 0 or signed constant. This patch matches the one from development. If just returns the L-value if the shift is a NOP. --- tgt-vvp/eval_expr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 7dba33365..82e7369b8 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -733,7 +733,7 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid) /* shifting 0 gets 0. */ if (lv.base == 0) - break; + return lv; if (lv.base < 4) { struct vector_info tmp; @@ -760,7 +760,7 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid) /* shifting 0 gets 0. */ if (lv.base == 0) - break; + return lv; if (lv.base < 4) { struct vector_info tmp; @@ -787,12 +787,12 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid) /* shifting 0 gets 0. */ if (lv.base == 0) - break; + return lv; /* Sign extend any constant begets itself, if this expression is signed. */ if ((lv.base < 4) && (ivl_expr_signed(exp))) - break; + return lv; if (lv.base < 4) { struct vector_info tmp;