start support for machine operands in spec files
authorMatthias Braun <matze@braunis.de>
Fri, 22 Jun 2007 12:58:59 +0000 (12:58 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 22 Jun 2007 12:58:59 +0000 (12:58 +0000)
[r14720]

ir/be/scripts/generate_new_opcodes.pl

index 1696c71..873d83c 100755 (executable)
@@ -37,6 +37,7 @@ my $line_nr    = 0;
 our $arch;
 our $additional_opcodes;
 our %nodes;
+our %operands;
 our %cpu;
 our $default_attr_type;
 our $default_cmp_attr;
@@ -75,6 +76,30 @@ if(!defined(%compare_attr)) {
        );
 }
 
+foreach my $op (keys(%operands)) {
+       my %operand = %{ $operands{"$op"} };
+       my %op_node;
+
+       # constraints
+       if(defined($operand{op_flags})) { die "Fatal error: operands can't have op_flags ($op)"; }
+       if(defined($operand{cmp_attr})) { die "Fatal error: cmp_attr not allowed for operands ($op)"; }
+       if(defined($operand{mode})) { die "Operand must not have a mode defined ($op)"; }
+       if(defined($operand{out_arity})) { die "operand must not have out_arity defined ($op)"; }
+       if(defined($nodes{$op})) { die "$op defined as operand and as node"; };
+
+
+       foreach my $flag (keys(%operand)) {
+               $op_node{$flag} = $operand{$flag};
+       }
+       $op_node{op_flags} = "O";
+       $op_node{cmp_attr} = 'return 1;';
+       $op_node{mode}     = 'mode_any';
+
+       $nodes{$op} = \%op_node;
+
+       print Dumper(%op_node);
+}
+
 #print Dumper(%nodes);
 #print Dumper(%operands);