Commit 399267c5 authored by yb9976's avatar yb9976
Browse files

Revert "disallow Muxb and Cmp(mode_b, mode_b)."

This reverts commit bf8ff592
and fixes opt/ifconv7.c.
parent 5907355f
......@@ -733,8 +733,8 @@ static int verify_node_Not(const ir_node *n)
static int verify_node_Cmp(const ir_node *n)
bool fine = check_mode(n, mode_b);
fine &= check_input_func(n, n_Cmp_left, "left", mode_is_data, "data");
fine &= check_input_func(n, n_Cmp_right, "right", mode_is_data, "data");
fine &= check_input_func(n, n_Cmp_left, "left", mode_is_datab, "datab");
fine &= check_input_func(n, n_Cmp_right, "right", mode_is_datab, "datab");
ir_mode *model = get_irn_mode(get_Cmp_left(n));
ir_mode *moder = get_irn_mode(get_Cmp_right(n));
if (model != moder) {
......@@ -875,7 +875,7 @@ static int verify_node_Confirm(const ir_node *n)
static int verify_node_Mux(const ir_node *n)
bool fine = check_mode_func(n, mode_is_data, "data or mode_b");
bool fine = check_mode_func(n, mode_is_datab, "data or mode_b");
fine &= check_input_mode(n, n_Mux_sel, "sel", mode_b);
fine &= check_mode_same_input(n, n_Mux_true, "true");
fine &= check_mode_same_input(n, n_Mux_false, "false");
......@@ -161,6 +161,21 @@ static ir_node *lower_node(ir_node *node)
case iro_Mux: {
ir_node *cond = get_Mux_sel(node);
ir_node *low_cond = lower_node(cond);
ir_node *v_true = get_Mux_true(node);
ir_node *low_v_true = lower_node(v_true);
ir_node *v_false = get_Mux_false(node);
ir_node *low_v_false = lower_node(v_false);
ir_node *and0 = new_rd_And(dbgi, block, low_cond, low_v_true, mode);
ir_node *not_cond = create_not(dbgi, low_cond);
ir_node *and1 = new_rd_And(dbgi, block, not_cond, low_v_false, mode);
res = new_rd_Or(dbgi, block, and0, and1, mode);
case iro_Cmp:
res = create_cond_set(node, mode);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment