diff options
author | Peter Johnson <peter@tortall.net> | 2007-06-30 19:46:36 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2007-06-30 19:46:36 +0000 |
commit | 7949bdf4e08a9e0003eb28e9ae2d70e48e4426af (patch) | |
tree | c5f4cbc25c9230c8e6c48272d7d005347e250675 /libyasm | |
parent | 81ef8abfe5aa9924aa0594ac99e977c98030a82f (diff) | |
download | yasm-7949bdf4e08a9e0003eb28e9ae2d70e48e4426af.tar.gz |
Optimize negating a simple intnum.
svn path=/trunk/yasm/; revision=1886
Diffstat (limited to 'libyasm')
-rw-r--r-- | libyasm/expr.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |