From 7333257119adc9883f90bf5ae1652001f4abf63d Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Mon, 18 Sep 2006 20:13:23 +0000 Subject: [PATCH] * config/bfin-parse.y (binary): Change sub of const to add of negated const. --- gas/ChangeLog | 5 +++++ gas/config/bfin-parse.y | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 64b3470c5df..1b939edd52c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2006-09-18 Bernd Schmidt + + * config/bfin-parse.y (binary): Change sub of const to add of negated + const. + 2006-09-17 Mei Ligang * config/tc-score.c: New file. diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index f74074e55a1..b3416aa1130 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -4328,6 +4328,12 @@ binary (Expr_Op_Type op, Expr_Node *x, Expr_Node *y) x = y; y = t; } + /* Canonicalize subtraction of const to addition of negated const. */ + if (op == Expr_Op_Type_Sub && y->type == Expr_Node_Constant) + { + op = Expr_Op_Type_Add; + y->value.i_value = -y->value.i_value; + } if (y->type == Expr_Node_Constant && x->type == Expr_Node_Binop && x->Right_Child->type == Expr_Node_Constant) { -- 2.30.2