*/
#include "gen_$arch\_regalloc_if.h"
-#include "bearch_ia32_t.h" /* we need this to put the caller saved registers into the isa set */
-#include "ia32_map_regs.h"
+#include "bearch_$arch\_t.h" /* we need this to put the caller saved registers into the isa set */
+#include "$arch\_map_regs.h"
#include "irmode.h"
EOF
print OUT "arch_register_class_t $arch\_reg_classes[] = {\n ".join(",\n ", @obst_regclasses)."\n};\n\n";
print OUT "void ".$arch."_register_init(void *isa_ptr) {\n";
-print OUT " ia32_isa_t *isa = (ia32_isa_t *)isa_ptr;\n\n";
print OUT @obst_reginit;
print OUT "}\n\n";
if ($reqs[$idx] eq "none") {
$tmp .= "&$arch\_default_req_none\n";
}
+ elsif ($reqs[$idx] =~ /^new_reg_(.*)$/) {
+ if (is_reg_class($1)) {
+ $tmp .= "&_".$op."_reg_req_$inout\_$idx\n";
+ $tmp2 .= "{\n";
+ $tmp2 .= " {\n";
+ $tmp2 .= " arch_register_req_type_should_be_different_from_all,\n";
+ $tmp2 .= " &$arch\_reg_classes[CLASS_$arch\_".$1."],\n";
+ $tmp2 .= " NULL, /* limit function */\n";
+ $tmp2 .= " NULL, /* limit environment */\n";
+ $tmp2 .= " NULL, /* same node */\n";
+ $tmp2 .= " NULL /* different node */\n";
+ $tmp2 .= " },\n";
+ $tmp2 .= " 0,\n";
+ $tmp2 .= " 0\n";
+ $tmp2 .= "};\n";
+
+ push(@obst_req, $tmp2."\n");
+ push(@obst_header_all, "extern const $arch\_register_req_t _".$op."_reg_req_$inout\_$idx;\n");
+ }
+ else {
+ print STDERR "Invalid register class '$1' given in OUT requirement $idx for '$op'.\n";
+ }
+ }
elsif (is_reg_class($reqs[$idx])) {
$tmp .= "&$arch\_default_req_".$arch."_".$reqs[$idx]."\n";
}
###
sub get_reg_class {
my $reg = shift;
+ $reg = substr($reg, 1) if ($reg =~ /!.*/);
return $reg2class{"$reg"}{"class"} if (exists($reg2class{"$reg"}));
return undef;
}
# set/unset registers
CHECK_REQS: foreach (@regs) {
if (/(!)?$outin\_r(\d+)/) {
- if (($1 && defined($different_pos)) || defined($same_pos)) {
+ if (($1 && defined($different_pos)) || (!$1 && defined($same_pos))) {
print STDERR "Multiple in/out references of same type in one requirement not allowed.\n";
return (undef, undef, undef, undef);
}