upon a function call. It thus can be overwritten
in the called function. */
arch_register_type_ignore = 4, /**< Do not consider this register when allocating. */
+ arch_register_type_joker = 8, /**< The emitter can choose an arbitrary register */
} arch_register_type_t;
/**
return reg->index;
}
+static INLINE const char *_arch_register_get_name(const arch_register_t *reg)
+{
+ return reg->name;
+}
+
#define arch_register_get_class(reg) _arch_register_get_class(reg)
#define arch_register_get_index(reg) _arch_register_get_index(reg)
-#define arch_register_get_name(reg) ((reg)->name)
+#define arch_register_get_name(reg) _arch_register_get_name(reg)
/**
* A class of registers.
/** return the largest mode of this register class */
#define arch_register_class_mode(cls) ((cls)->mode)
+/** return the name of this register class */
+#define arch_register_class_name(cls) ((cls)->name)
+
/**
* Put all registers in a class into a bitset.
* @param cls The class.
*/
extern void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls, bitset_t *bs);
-/**
- * Return the number of registers in a register class which should not be
- * ignored by the register allocator.
- * @param env The architecture environment.
- * @param cls The register class to consider
- * @return The number of non-ignore registers in the register class
- */
-extern int arch_count_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls);
-
/**
* Check, if a register is assignable to an operand of a node.
* @param env The architecture environment.
* ISA base class.
*/
struct _arch_isa_t {
- const arch_isa_if_t *impl;
+ const arch_isa_if_t *impl;
const arch_register_t *sp; /** The stack pointer register. */
const arch_register_t *bp; /** The base pointer register. */
const int stack_dir; /** -1 for decreasing, 1 for increasing. */
+ const be_main_env_t *main_env; /** the be main environment */
};
#define arch_isa_stack_dir(isa) ((isa)->stack_dir)
/**
* Initialize the isa interface.
- * @param file_handle the file handle to write the output to
- * @return a new isa instance
+ * @param file_handle the file handle to write the output to
+ * @param main_env the be main environment
+ * @return a new isa instance
*/
void *(*init)(FILE *file_handle);
const arch_code_generator_if_t *(*get_code_generator_if)(void *self);
/**
- * Get the list scheduler to use.
- * @param self The isa object.
+ * Get the list scheduler to use. There is already a selector given, the
+ * backend is free to modify and/or ignore it.
+ *
+ * @param self The isa object.
+ * @param selector The selector given by options.
* @return The list scheduler selector.
*/
- const list_sched_selector_t *(*get_list_sched_selector)(const void *self);
+ const list_sched_selector_t *(*get_list_sched_selector)(const void *self, list_sched_selector_t *selector);
/**
* Get the necessary alignment for storing a register of given class.
* @param file_handle The file handle
* @return The environment.
*/
-extern arch_env_t *arch_env_init(arch_env_t *env, const arch_isa_if_t *isa, FILE *file_handle);
+extern arch_env_t *arch_env_init(arch_env_t *env, const arch_isa_if_t *isa, FILE *file_handle, be_main_env_t *main_env);
/**
* Add a node handler to the environment.
*/
extern const arch_irn_handler_t *arch_env_pop_irn_handler(arch_env_t *env);
-
#endif /* _FIRM_BEARCH_H */