remove Carry+Borrow node
authorMatthias Braun <matze@braunis.de>
Tue, 4 Dec 2012 01:39:46 +0000 (02:39 +0100)
committerMatthias Braun <matze@braunis.de>
Tue, 4 Dec 2012 17:15:04 +0000 (18:15 +0100)
ir/ir/iropt.c
scripts/ir_spec.py

index 5ef18d2..0ae374a 100644 (file)
@@ -182,48 +182,6 @@ static ir_tarval *computed_value_Sub(const ir_node *n)
        return tarval_bad;
 }
 
-/**
- * Return the value of a Carry.
- * Special : a op 0, 0 op b
- */
-static ir_tarval *computed_value_Carry(const ir_node *n)
-{
-       ir_node   *a  = get_binop_left(n);
-       ir_node   *b  = get_binop_right(n);
-       ir_mode   *m  = get_irn_mode(n);
-       ir_tarval *ta = value_of(a);
-       ir_tarval *tb = value_of(b);
-
-       if ((ta != tarval_bad) && (tb != tarval_bad)) {
-               tarval_add(ta, tb);
-               return tarval_carry() ? get_mode_one(m) : get_mode_null(m);
-       } else {
-               if (tarval_is_null(ta) || tarval_is_null(tb))
-                       return get_mode_null(m);
-       }
-       return tarval_bad;
-}
-
-/**
- * Return the value of a Borrow.
- * Special : a op 0
- */
-static ir_tarval *computed_value_Borrow(const ir_node *n)
-{
-       ir_node   *a  = get_binop_left(n);
-       ir_node   *b  = get_binop_right(n);
-       ir_mode   *m  = get_irn_mode(n);
-       ir_tarval *ta = value_of(a);
-       ir_tarval *tb = value_of(b);
-
-       if ((ta != tarval_bad) && (tb != tarval_bad)) {
-               return tarval_cmp(ta, tb) == ir_relation_less ? get_mode_one(m) : get_mode_null(m);
-       } else if (tarval_is_null(ta)) {
-               return get_mode_null(m);
-       }
-       return tarval_bad;
-}
-
 /**
  * Return the value of an unary Minus.
  */
@@ -6289,8 +6247,6 @@ void ir_register_opt_node_ops(void)
 {
        register_computed_value_func(op_Add,      computed_value_Add);
        register_computed_value_func(op_And,      computed_value_And);
-       register_computed_value_func(op_Borrow,   computed_value_Borrow);
-       register_computed_value_func(op_Carry,    computed_value_Carry);
        register_computed_value_func(op_Cmp,      computed_value_Cmp);
        register_computed_value_func(op_Confirm,  computed_value_Confirm);
        register_computed_value_func(op_Const,    computed_value_Const);
index b144814..2f80886 100755 (executable)
@@ -240,11 +240,6 @@ class Block:
        }
        '''
 
-@op
-class Borrow(Binop):
-       """Returns the borrow bit from and implied subtractions of its 2 operands"""
-       flags = []
-
 @op
 class Bound:
        """Performs a bounds-check: if lower <= index < upper then return index,
@@ -333,12 +328,6 @@ class Call:
        assert((get_unknown_type() == type) || is_Method_type(type));
        '''
 
-@op
-class Carry(Binop):
-       """Computes the value of the carry-bit that would result when adding the 2
-       operands"""
-       flags = [ "commutative" ]
-
 @op
 class Cast(Unop):
        """perform a high-level type cast"""