X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fscripts%2Fgenerate_regalloc_if.pl;h=0f310b36e26f9f37ca542263a7fb4f528680e48f;hb=b3846b62b473eae163a25127f7bd361d24e0c871;hp=21f336b2465bc3672461594b670dc1fc8a230869;hpb=8dd5021d5b6421c1c7b13561308cb3aa7f667355;p=libfirm diff --git a/ir/be/scripts/generate_regalloc_if.pl b/ir/be/scripts/generate_regalloc_if.pl index 21f336b24..0f310b36e 100755 --- a/ir/be/scripts/generate_regalloc_if.pl +++ b/ir/be/scripts/generate_regalloc_if.pl @@ -54,6 +54,10 @@ sub translate_reg_type { push(@types, "arch_register_type_ignore"); } + if ($t & 8) { + push(@types, "arch_register_type_joker"); + } + return join(" | ", @types); } } @@ -505,7 +509,9 @@ sub build_subset_class_func { my $same_pos = undef; my $different_pos = undef; my $temp; - my @temp_obst; + my @obst_init; + my @obst_limits; + my @obst_ignore; # build function header @@ -549,7 +555,7 @@ CHECK_REQS: foreach (@regs) { if (!defined($neg)) { $has_limit = 1; - push(@temp_obst, " bs = bitset_set_all(bs); /* allow all register (negative constraints given) */\n"); + push(@obst_init, " bs = bitset_set_all(bs); /* allow all register (negative constraints given) */\n"); } $_ = substr($_, 1); # skip '!' @@ -565,7 +571,7 @@ CHECK_REQS: foreach (@regs) { if (!defined($neg)) { $has_limit = 1; - push(@temp_obst, " bs = bitset_clear_all(bs); /* disallow all register (positive constraints given) */\n"); + push(@obst_init, " bs = bitset_clear_all(bs); /* disallow all register (positive constraints given) */\n"); } $neg = 0; } @@ -589,19 +595,19 @@ CHECK_REQS: foreach (@regs) { if ($neg == 1) { $has_limit = 1; - push(@temp_obst, " bitset_clear(bs, ".get_reg_index($_)."); /* disallow $_ */\n"); + push(@obst_limits, " bitset_clear(bs, ".get_reg_index($_)."); /* disallow $_ */\n"); } else { $has_limit = 1; - push(@temp_obst, " bitset_set(bs, ".get_reg_index($_)."); /* allow $_ */\n"); + push(@obst_limits, " bitset_set(bs, ".get_reg_index($_)."); /* allow $_ */\n"); } } my @cur_class = @{ $reg_classes{"$class"} }; for (my $idx = 0; $idx <= $#cur_class; $idx++) { if (defined($cur_class[$idx]{"type"}) && ($cur_class[$idx]{"type"} & 4)) { - push(@temp_obst, " bitset_clear(bs, ".get_reg_index($cur_class[$idx]{"name"}).");"); - push(@temp_obst, " /* disallow ignore reg ".$cur_class[$idx]{"name"}." */\n"); + push(@obst_ignore, " bitset_clear(bs, ".get_reg_index($cur_class[$idx]{"name"}).");"); + push(@obst_ignore, " /* disallow ignore reg ".$cur_class[$idx]{"name"}." */\n"); } } @@ -610,7 +616,9 @@ CHECK_REQS: foreach (@regs) { push(@obst_limit_func, "/* limit the possible registers for ".($in ? "IN" : "OUT")." $idx at op $op */\n"); push(@obst_limit_func, "void limit_reg_".$op."_".($in ? "in" : "out")."_".$idx."(void *_unused, bitset_t *bs) {\n"); - push(@obst_limit_func, @temp_obst); + push(@obst_limit_func, @obst_init); + push(@obst_limit_func, @obst_ignore); + push(@obst_limit_func, @obst_limits); push(@obst_limit_func, "}\n\n"); }