- # For each class we build for each of it's member registers a limit function
- # which limits the class to this particular register. We also build the
- # corresponding requirement structs.
- # We need those functions to set register requirements on demand in transformation
- # esp. for Call and RegParams where we can mix int and float parameters.
-
- my $limit_func_name = $arch."_limit_".$class_name."_".$_->{"name"};
-
- # push the function prototype
- $tmp = "void $limit_func_name(void *_unused, bitset_t *bs)";
- push(@obst_defreq_head, $tmp.";\n");
-
- # push the function definition
- $tmp .= " {\n";
- $tmp .= " bs = bitset_clear_all(bs);\n";
- $tmp .= " bitset_set(bs, REG_".uc($_->{"name"}).");\n"; # REGISTER to index assignment is done some lines down
- $tmp .= "}\n\n";
- push(@obst_limit_func, $tmp);
-
- # push the default requirement struct
- $tmp = "const $arch\_register_req_t $arch\_default_req_$class_name\_".$_->{"name"}." = {\n";
- $tmp .= " {\n";
- $tmp .= " arch_register_req_type_limited,\n";
- $tmp .= " $class_ptr,\n";
- $tmp .= " $limit_func_name,\n";
- $tmp .= " NULL, /* limit environment */\n";
- $tmp .= " NULL, /* node for same */\n";
- $tmp .= " NULL /* node for different */\n";
- $tmp .= " },\n";
- $tmp .= " 0, /* same pos */\n";
- $tmp .= " 0 /* different pos */\n";
- $tmp .= "};\n\n";
- push(@obst_req, $tmp);
- push(@obst_header_all,"extern const $arch\_register_req_t $arch\_default_req_$class_name\_".$_->{"name"}.";\n");