sparc: split Mulh node into SMulh and UMulh
[libfirm] / ir / be / scripts / generate_regalloc_if.pl
index 50ebc66..284ca6b 100755 (executable)
@@ -61,26 +61,18 @@ sub translate_reg_type {
                my @types;
 
                if ($t & 1) {
-                       push(@types, "arch_register_type_caller_save");
-               }
-
-               if ($t & 2) {
-                       push(@types, "arch_register_type_callee_save");
-               }
-
-               if ($t & 4) {
                        push(@types, "arch_register_type_ignore");
                }
 
-               if ($t & 8) {
+               if ($t & 2) {
                        push(@types, "arch_register_type_joker");
                }
 
-               if ($t & 16) {
+               if ($t & 4) {
                        push(@types, "arch_register_type_virtual");
                }
 
-               if ($t & 32) {
+               if ($t & 8) {
                        push(@types, "arch_register_type_state");
                }
 
@@ -181,13 +173,9 @@ foreach my $class_name (keys(%reg_classes)) {
                        $flags_prepared .= "arch_register_class_flag_$flag";
                }
        } else {
-               $flags_prepared = "0";
+               $flags_prepared = "arch_register_class_flag_none";
        }
 
-       $single_constraints_decls .= <<EOF;
-static const arch_register_req_t ${arch}_class_reg_req_${old_classname};
-EOF
-
        $single_constraints .= <<EOF;
 static const arch_register_req_t ${arch}_class_reg_req_${old_classname} = {
        arch_register_req_type_normal,
@@ -277,14 +265,17 @@ print OUT<<EOF;
 #include "../bearch.h"
 #include "${arch}_nodes_attr.h"
 
+/** global register indices for ${arch} registers */
 enum reg_indices {
 ${regdef}
        N_${archuc}_REGISTERS
 };
+/** local register indices for ${arch} registers */
 enum {
 ${regdef2}
 };
 
+/** number of registers in ${arch} register classes. */
 enum {
 ${regcounts}
 };
@@ -295,7 +286,6 @@ extern const arch_register_t ${arch}_registers[N_${archuc}_REGISTERS];
 extern arch_register_class_t ${arch}_reg_classes[N_${archuc}_CLASSES];
 
 void ${arch}_register_init(void);
-unsigned ${arch}_get_n_regs(void);
 
 #endif
 EOF
@@ -325,18 +315,21 @@ print OUT<<EOF;
 #include "bearch_${arch}_t.h"
 #include "irmode.h"
 
-${single_constraints_decls}
+${single_constraints}
 EOF
 
 print OUT "arch_register_class_t ${arch}_reg_classes[] = {\n\t".join(",\n\t", @regclasses)."\n};\n\n";
 
 print OUT<<EOF;
-${single_constraints}
 
+/** The array of all registers in the ${arch} architecture, sorted by its global index.*/
 const arch_register_t ${arch}_registers[] = {
 ${regtypes_def}
 };
 
+/**
+ * Initializes ${arch} register classes.
+ */
 void ${arch}_register_init(void)
 {
 ${reginit}