From: Christian Würdig Date: Wed, 15 Nov 2006 11:50:17 +0000 (+0000) Subject: added ports per unit X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=6fe833ef99a6bd1194647e73fb25d1fe49771ff2;p=libfirm added ports per unit --- diff --git a/ir/be/ia32/ia32_spec.pl b/ir/be/ia32/ia32_spec.pl index bc430d2e5..3935c8242 100644 --- a/ir/be/ia32/ia32_spec.pl +++ b/ir/be/ia32/ia32_spec.pl @@ -183,13 +183,13 @@ $comment_string = "/*"; ); # %reg_classes %cpu = ( - "ALU" => [ "ALU1", "ALU2", "ALU3", "ALU4" ], - "MUL" => [ "MUL1", "MUL2" ], - "SSE" => [ "SSE1", "SSE2" ], - "FPU" => [ "FPU1" ], - "MEM" => [ "MEM1", "MEM2" ], - "BRANCH" => [ "BRANCH1", "BRANCH2" ], - "DUMMY" => [ "DUMMY1", "DUMMY2", "DUMMY3", "DUMMY4" ] + "ALU" => [ 1, "ALU1", "ALU2", "ALU3", "ALU4" ], + "MUL" => [ 1, "MUL1", "MUL2" ], + "SSE" => [ 1, "SSE1", "SSE2" ], + "FPU" => [ 1, "FPU1" ], + "MEM" => [ 1, "MEM1", "MEM2" ], + "BRANCH" => [ 1, "BRANCH1", "BRANCH2" ], + "DUMMY" => [ 1, "DUMMY1", "DUMMY2", "DUMMY3", "DUMMY4" ] ); # %cpu %vliw = ( diff --git a/ir/be/scripts/generate_machine.pl b/ir/be/scripts/generate_machine.pl index 831aafa96..9151d0e35 100755 --- a/ir/be/scripts/generate_machine.pl +++ b/ir/be/scripts/generate_machine.pl @@ -53,9 +53,9 @@ if ($has_desc) { foreach my $unit_type (keys(%cpu)) { my $tp_name = "$tmp\_EXECUNIT_TP_$unit_type"; my @cur_tp = @{ $cpu{"$unit_type"} }; - my $num_units = scalar(@cur_tp); + my $num_units = scalar(@cur_tp) - 1; - push(@obst_init_unit_types, "\t{ $num_units, \"$unit_type\", $arch\_execution_units_$unit_type },\n"); + push(@obst_init_unit_types, "\t{ $num_units, ".shift(@cur_tp).", \"$unit_type\", $arch\_execution_units_$unit_type },\n"); push(@obst_execunits, "be_execution_unit_t $arch\_execution_units_".$unit_type."[$num_units];\n"); push(@obst_execunits_header, "extern be_execution_unit_t $arch\_execution_units_".$unit_type."[$num_units];\n"); @@ -65,6 +65,7 @@ foreach my $unit_type (keys(%cpu)) { push(@obst_unit_defs, "/* enum for execution units of type $unit_type */\n"); push(@obst_unit_defs, "enum $arch\_execunit_tp_$unit_type\_vals {\n"); + foreach my $unit (@cur_tp) { my $unit_name = "$tp_name\_$unit"; diff --git a/ir/be/scripts/generate_new_opcodes.pl b/ir/be/scripts/generate_new_opcodes.pl index b9b5056d0..a5dc2ad68 100755 --- a/ir/be/scripts/generate_new_opcodes.pl +++ b/ir/be/scripts/generate_new_opcodes.pl @@ -529,7 +529,9 @@ sub gen_execunit_list_initializer { # operation can be executed on all units of this type # -> add them all my $tp_name = "$arch\_execution_units_$unit"; + my $idx = 0; foreach (@{ $cpu{"$unit"} }) { + next if ($idx++ == 0); # skip first element (it's not a unit) my $unit_name = "$uc_arch\_EXECUNIT_TP_$unit\_$_"; push(@{ $init{"$unit"} }, " &".$tp_name."[".$unit_name."]"); }