Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
5d8892b2
Commit
5d8892b2
authored
Dec 04, 2012
by
Matthias Braun
Browse files
remove Carry+Borrow node
parent
f0c1a882
Changes
2
Show whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
5d8892b2
...
...
@@ -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
);
...
...
scripts/ir_spec.py
View file @
5d8892b2
...
...
@@ -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"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment