]> granicus.if.org Git - yasm/commitdiff
Optimize negating a simple intnum.
authorPeter Johnson <peter@tortall.net>
Sat, 30 Jun 2007 19:46:36 +0000 (19:46 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 30 Jun 2007 19:46:36 +0000 (19:46 -0000)
svn path=/trunk/yasm/; revision=1886

libyasm/expr.c

index c392cdf3fc02025eb51df1f0cad85b8ef0f22f9c..470184dfca86a901fad84d0e75d23fa59dce5008 100644 (file)
@@ -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);