From eb593ca265a302849042866b57a3cf7a6e9495ab Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 4 Oct 2008 07:59:00 +0000 Subject: [PATCH] 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] --- ir/be/ia32/bearch_ia32.c | 4 ---- ir/be/ia32/ia32_new_nodes.c | 6 +++--- ir/be/ia32/ia32_nodes_attr.h | 3 +-- ir/be/ia32/ia32_spec.pl | 6 ++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index 4a2856c18..da57bca85 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -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"); } diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c index 91efb7759..fb806a55c 100644 --- a/ir/be/ia32/ia32_new_nodes.c +++ b/ir/be/ia32/ia32_new_nodes.c @@ -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); } /** diff --git a/ir/be/ia32/ia32_nodes_attr.h b/ir/be/ia32/ia32_nodes_attr.h index d45791b19..5bd3ca229 100644 --- a/ir/be/ia32/ia32_nodes_attr.h +++ b/ir/be/ia32/ia32_nodes_attr.h @@ -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 { diff --git a/ir/be/ia32/ia32_spec.pl b/ir/be/ia32/ia32_spec.pl index 77be75ee3..0249eddf4 100644 --- a/ir/be/ia32/ia32_spec.pl +++ b/ir/be/ia32/ia32_spec.pl @@ -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" ], -- 2.20.1