added hook for projnum register translation
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Thu, 19 Jan 2006 17:23:53 +0000 (17:23 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Thu, 19 Jan 2006 17:23:53 +0000 (17:23 +0000)
added macro and irn class

ir/be/bearch.h

index 3801a87..e20b836 100644 (file)
@@ -45,6 +45,15 @@ typedef enum _arch_register_type_t {
   arch_register_type_ignore           /**< Do not consider this register when allocating. */
 } arch_register_type_t;
 
+/**
+ * Convenience macro to check for register type.
+ * @param req   A pointer to register.
+ * @param kind  The kind of type to check for (see arch_register_type_t).
+ * @return      1, If register is of given kind, 0 if not.
+ */
+#define arch_register_type_is(reg, kind) \
+       ((reg)->type == arch_register_type_ ## kind)
+
 /**
  * A register.
  */
@@ -176,7 +185,8 @@ typedef enum _arch_irn_class_t {
   arch_irn_class_reload,
   arch_irn_class_copy,
   arch_irn_class_perm,
-  arch_irn_class_branch
+  arch_irn_class_branch,
+  arch_irn_class_call
 } arch_irn_class_t;
 
 /**
@@ -472,6 +482,14 @@ struct _arch_isa_if_t {
    * @return      The list scheduler selector.
    */
   const list_sched_selector_t *(*get_list_sched_selector)(const void *self);
+
+  /**
+   * Get the proj number assigned to the register.
+   * @param self  The isa object.
+   * @param reg   The register
+   * @return      The proj number assigned to this register
+   */
+  long (*get_projnum_for_register)(const void *self, const arch_register_t *reg);
 };
 
 #define arch_isa_get_n_reg_class(isa)           ((isa)->impl->get_n_reg_class(isa))