Commit eb593ca2 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Remove ia32_am_ternary. The only users were Div an IDiv, which are perfectly...

Remove ia32_am_ternary.  The only users were Div an IDiv, which are perfectly fine with being declared unary.  Further the only place, where the value was tested (in turn_back_am()) set the wrong operand then.  Though, effectively this was unreachable code, because Div/IDiv generate no sensible flags.

[r22456]
parent 2f7da22a
......@@ -1045,10 +1045,6 @@ static void turn_back_am(ir_node *node)
}
break;
case ia32_am_ternary:
set_irn_n(node, n_ia32_binary_right, load_res);
break;
default:
panic("Unknown arity");
}
......
......@@ -493,9 +493,9 @@ void set_ia32_am_support(ir_node *node, ia32_am_type_t am_tp,
attr->data.am_support = am_tp;
attr->data.am_arity = arity;
assert((am_tp == ia32_am_None && arity == ia32_am_arity_none) ||
(am_tp != ia32_am_None &&
((arity == ia32_am_unary) || (arity == ia32_am_binary) || (arity == ia32_am_ternary))));
assert(am_tp == ia32_am_None ?
arity == ia32_am_arity_none :
arity == ia32_am_unary || arity == ia32_am_binary);
}
/**
......
......@@ -52,8 +52,7 @@ typedef enum {
typedef enum {
ia32_am_arity_none = 0,
ia32_am_unary = 1,
ia32_am_binary = 2,
ia32_am_ternary = 3,
ia32_am_binary = 2
} ia32_am_arity_t;
typedef enum {
......
......@@ -256,8 +256,6 @@ sub ia32_custom_init_attr {
$res .= "\tset_ia32_am_support(res, ia32_am_Source, ia32_am_unary);";
} elsif($am eq "source,binary") {
$res .= "\tset_ia32_am_support(res, ia32_am_Source, ia32_am_binary);";
} elsif($am eq "source,ternary") {
$res .= "\tset_ia32_am_support(res, ia32_am_Source, ia32_am_ternary);";
} elsif($am eq "none") {
# nothing to do
} else {
......@@ -682,7 +680,7 @@ IDiv => {
out => [ "eax", "flags", "none", "edx", "none" ] },
ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
am => "source,ternary",
am => "source,unary",
emit => ". idiv%M %unop3",
latency => 25,
units => [ "GP" ],
......@@ -696,7 +694,7 @@ Div => {
out => [ "eax", "flags", "none", "edx", "none" ] },
ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
outs => [ "div_res", "flags", "M", "mod_res", "X_exc" ],
am => "source,ternary",
am => "source,unary",
emit => ". div%M %unop3",
latency => 25,
units => [ "GP" ],
......
Supports Markdown
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