From 7949bdf4e08a9e0003eb28e9ae2d70e48e4426af Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 30 Jun 2007 19:46:36 +0000 Subject: [PATCH] Optimize negating a simple intnum. svn path=/trunk/yasm/; revision=1886 --- libyasm/expr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libyasm/expr.c b/libyasm/expr.c index c392cdf3..470184df 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -420,6 +420,8 @@ expr_xform_neg_helper(/*@returned@*/ /*@only@*/ yasm_expr *e) */ if (e->terms[0].type == YASM_EXPR_FLOAT) yasm_floatnum_calc(e->terms[0].data.flt, YASM_EXPR_NEG, NULL); + else if (e->terms[0].type == YASM_EXPR_INT) + yasm_intnum_calc(e->terms[0].data.intn, YASM_EXPR_NEG, NULL); else if (e->terms[0].type == YASM_EXPR_EXPR && yasm_expr__contains(e->terms[0].data.expn, YASM_EXPR_FLOAT)) expr_xform_neg_helper(e->terms[0].data.expn); -- 2.40.0