From f8fd499bf676c8e8535e70929f4fbde65abfa10a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Sun, 13 Aug 2006 13:22:26 +0000 Subject: [PATCH] while limiting registers: clear ignore registers before applying limits from config, otherwise esp is always cleared --- ir/be/scripts/generate_regalloc_if.pl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ir/be/scripts/generate_regalloc_if.pl b/ir/be/scripts/generate_regalloc_if.pl index 21f336b24..f684c1c4e 100755 --- a/ir/be/scripts/generate_regalloc_if.pl +++ b/ir/be/scripts/generate_regalloc_if.pl @@ -505,7 +505,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 +551,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 +567,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 +591,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 +612,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"); } -- 2.20.1