X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Farch%2Farchop.c;h=a23c467e3aa5a082f5995c38320cf3c486b0f483;hb=bb5c6d5ce2e35c4074900017f8c8e1a4935054d0;hp=1bb4ce59531e2f34e8369940173fb934f8b7df9e;hpb=f0ad4dd32e5f4508ccfffca77a5d54d19f7c0dc3;p=libfirm diff --git a/ir/arch/archop.c b/ir/arch/archop.c index 1bb4ce595..a23c467e3 100644 --- a/ir/arch/archop.c +++ b/ir/arch/archop.c @@ -40,6 +40,8 @@ #include "irvrfy_t.h" #include "iropt_dbg.h" #include "archop.h" +#include "irop.h" +#include "error.h" /* when we need verifying */ #ifdef NDEBUG @@ -57,15 +59,6 @@ static const arch_ops_info default_settings = { 0 }; -/** The Min operation */ -ir_op *op_Min = NULL; - -/** The Max operation */ -ir_op *op_Max = NULL; - -ir_op *get_op_Min(void) { return op_Min; } -ir_op *get_op_Max(void) { return op_Max; } - /* * construct a Min: Min(a,b) = a < b ? a : b */ @@ -77,8 +70,7 @@ new_rd_Min(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *res; if (! op_Min) { - assert(0); - return NULL; + panic("cannot create Min node, not allowed"); } in[0] = op1; @@ -100,8 +92,7 @@ new_rd_Max(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *res; if (! op_Max) { - assert(0); - return NULL; + panic("cannot create Max node, not allowed"); } in[0] = op1; @@ -248,7 +239,7 @@ ir_node *arch_transform_node_Mux(ir_node *n) return n; cmp = get_Proj_pred(proj); - if (get_irn_op(cmp) == op_Cmp) { + if (is_Cmp(cmp)) { ir_node *a = get_Cmp_left(cmp); ir_node *b = get_Cmp_right(cmp); ir_node *t = get_Mux_true(n); @@ -343,16 +334,12 @@ void firm_archops_init(const arch_ops_info *info) if (info->enabled_ops & ARCH_OPS_MINMAX) { memset(&ops, 0, sizeof(ops)); - ops.computed_value = computed_value_Min; - ops.equivalent_node = equivalent_node_Min; - ops.verify_node = verify_node_MinMax; - - op_Min = new_ir_op(iro_Min, "Min", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0, &ops); - - ops.computed_value = computed_value_Max; - ops.equivalent_node = equivalent_node_Max; - ops.verify_node = verify_node_MinMax; + op_Min->ops.computed_value = computed_value_Min; + op_Min->ops.equivalent_node = equivalent_node_Min; + op_Min->ops.verify_node = verify_node_MinMax; - op_Max = new_ir_op(iro_Max, "Max", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0, &ops); + op_Max->ops.computed_value = computed_value_Max; + op_Max->ops.equivalent_node = equivalent_node_Max; + op_Max->ops.verify_node = verify_node_MinMax; } }