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");
}
$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,
$reginit .= "\t$arch\_reg_classes[CLASS_".$class_name."].mode = $class_mode;\n";
my $lastreg;
foreach (@class) {
- my $name = $_->{"name"};
+ my $name = $_->{"name"};
my $ucname = uc($name);
- my $type = translate_reg_type($_->{"type"});
+ my $type = "arch_register_type_none";
+ $type = translate_reg_type($_->{"type"}) if (exists($_->{"type"}));
# realname is name if not set by user
$_->{"realname"} = $_->{"name"} if (! exists($_->{"realname"}));
my $realname = $_->{realname};
#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}
};
extern arch_register_class_t ${arch}_reg_classes[N_${archuc}_CLASSES];
void ${arch}_register_init(void);
-unsigned ${arch}_get_n_regs(void);
#endif
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}