X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fscripts%2Fgenerate_new_opcodes.pl;h=1a634a6e37c5ba6b7623fdcf873022de63c0566a;hb=93da909d12b7bec51aa36ee5f05966c331f90fb9;hp=2246f0621ed708d2072a61eba0a552489595dfa1;hpb=4eea973fa1c2562a6020706ea091ff713cf0686a;p=libfirm diff --git a/ir/be/scripts/generate_new_opcodes.pl b/ir/be/scripts/generate_new_opcodes.pl index 2246f0621..1a634a6e3 100755 --- a/ir/be/scripts/generate_new_opcodes.pl +++ b/ir/be/scripts/generate_new_opcodes.pl @@ -265,6 +265,12 @@ foreach my $op (keys(%nodes)) { $attr_type = $default_attr_type; } + # determine hash function + my $hash_func; + if (exists($n{"hash_func"})) { + $hash_func = $n{"hash_func"}; + } + # determine compare function my $cmp_attr_func; if (exists($n{"cmp_attr"})) { @@ -575,6 +581,9 @@ foreach my $op (keys(%nodes)) { if (defined($copy_attr_func)) { push(@obst_new_irop, "\tops.copy_attr = ${copy_attr_func};\n"); } + if (defined($hash_func)) { + push(@obst_new_irop, "\tops.hash = ${hash_func};\n"); + } $n_opcodes++; my $n_res = $out_arity; @@ -584,10 +593,9 @@ foreach my $op (keys(%nodes)) { $temp = "\top_$op = new_ir_op(cur_opcode + iro_$op, \"$op\", op_pin_state_".$n{"state"}.", ".$n{"op_flags"}; $temp .= "|M, ".translate_arity($arity).", 0, sizeof(${attr_type}), &ops);\n"; push(@obst_new_irop, $temp); - push(@obst_new_irop, "\tset_op_tag(op_$op, &$arch\_op_tag);\n"); + push(@obst_new_irop, "\tset_op_tag(op_$op, $arch\_op_tag);\n"); if(defined($default_op_attr_type)) { - push(@obst_new_irop, "\tattr = ($default_op_attr_type *) xmalloc(sizeof(attr[0]));\n"); - push(@obst_new_irop, "\tmemset(attr, 0, sizeof(attr[0]));\n"); + push(@obst_new_irop, "\tattr = &attrs[iro_$op];\n"); if(defined($n{op_attr_init})) { push(@obst_new_irop, "\t".$n{op_attr_init}."\n"); } @@ -645,7 +653,7 @@ if (length($arch) >= 4) { print OUT<