added option to select between schedulers (list or ilp)
[libfirm] / ir / be / bearch.h
index 1f3cc84..5bb7bf8 100644 (file)
@@ -20,13 +20,15 @@ struct _be_node_factory_t;
 
 typedef enum _arch_register_type_t {
   arch_register_type_none         = 0,
-  arch_register_type_caller_save  = 1, /**< The register must be saved by the caller
-                                            upon a function call. It thus can be overwritten
-                                            in the called function. */
-  arch_register_type_callee_save  = 2, /**< The register must be saved by the caller
-                                            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_caller_save  = 1,  /**< The register must be saved by the caller
+                                             upon a function call. It thus can be overwritten
+                                             in the called function. */
+  arch_register_type_callee_save  = 2,  /**< The register must be saved by the caller
+                                             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_virtual      = 16, /**< This is just a virtual register  */
 } arch_register_type_t;
 
 /**
@@ -60,9 +62,14 @@ static INLINE int _arch_register_get_index(const arch_register_t *reg)
   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.
@@ -81,6 +88,9 @@ struct _arch_register_class_t {
 /** 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.
@@ -585,10 +595,11 @@ struct _arch_code_generator_t {
  * 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)
@@ -602,8 +613,9 @@ struct _arch_isa_if_t {
 
   /**
    * 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);
 
@@ -727,7 +739,7 @@ struct _arch_env_t {
  * @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.
@@ -744,13 +756,4 @@ extern arch_env_t *arch_env_push_irn_handler(arch_env_t *env, const arch_irn_han
  */
 extern const arch_irn_handler_t *arch_env_pop_irn_handler(arch_env_t *env);
 
-/**
- * Tells whether function represented by entity should be
- * called in the constructor section.
- * @param arch_env The architecture environment.
- * @param ent The entity representing a function
- * @return 1 if function is a constructor
- */
-extern int arch_ent_is_constructor(const arch_env_t *arch_env, const entity * ent);
-
 #endif /* _FIRM_BEARCH_H */