Inline gen_Minus_ex() into its only caller gen_Minus().
[libfirm] / ir / be / bearch_t.h
index 7dc1ce0..3510418 100644 (file)
@@ -1,5 +1,30 @@
-#ifndef FIRM_BEARCH_T_H
-#define FIRM_BEARCH_T_H
+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief       Processor architecture specification - internal data structures.
+ * @author      Sebastian Hack
+ * @version     $Id$
+ */
+#ifndef FIRM_BE_BEARCH_T_H
+#define FIRM_BE_BEARCH_T_H
 
 #include "bearch.h"
 
@@ -26,12 +51,14 @@ _arch_register_get_class(const arch_register_t *reg)
        return reg->reg_class;
 }
 
-static INLINE int _arch_register_get_index(const arch_register_t *reg)
+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)
+static INLINE
+const char *_arch_register_get_name(const arch_register_t *reg)
 {
        return reg->name;
 }
@@ -54,10 +81,12 @@ static INLINE const char *_arch_register_get_name(const arch_register_t *reg)
  * Like general purpose or floating point.
  */
 struct arch_register_class_t {
-       const char *name;               /**< The name of the register class. */
-       int n_regs;                     /**< Number of registers in this class. */
-       ir_mode *mode;                  /**< The mode of the register class. */
-       const arch_register_t *regs;    /**< The array of registers. */
+       const char                  *name;   /**< The name of the register class.*/
+       int                          n_regs; /**< Number of registers in this
+                                                 class. */
+       ir_mode                     *mode;   /**< The mode of the register class.*/
+       const arch_register_t       *regs;   /**< The array of registers. */
+       arch_register_class_flags_t  flags;  /**< register class flags. */
 };
 
 /** return the number of registers in this register class */
@@ -69,6 +98,9 @@ struct arch_register_class_t {
 /** return the name of this register class */
 #define arch_register_class_name(cls) ((cls)->name)
 
+/** return the register class flags */
+#define arch_register_class_flags(cls) ((cls)->flags)
+
 static INLINE const arch_register_t *
 _arch_register_for_index(const arch_register_class_t *cls, int idx)
 {
@@ -96,8 +128,11 @@ struct arch_register_req_t {
 
        const unsigned *limited;            /**< allowed register bitset */
 
-       int other_same;                     /**< The in number which shall have
-                                                                                    the same res (should_be_same)*/
+       int other_same[2];                /**< The in numbers which shall have the
+                                              same res (should_be_same).  More than
+                                              two are unnecessary because there is
+                                              no machine with more than two
+                                              commutative inputs to one operation */
        int other_different;                /**< The other node from which this
                                                                                     one's register must be different
                                                                                         (case must_be_different). */
@@ -371,8 +406,10 @@ struct arch_isa_t {
        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 int              stack_dir; /** -1 for decreasing, 1 for increasing. */
        const be_main_env_t   *main_env;  /** the be main environment */
+       const int              spill_cost;  /** cost for a be_Spill node */
+       const int              reload_cost; /** cost for a be_Reload node */
 };
 
 #define arch_isa_stack_dir(isa)  ((isa)->stack_dir)
@@ -473,7 +510,8 @@ struct arch_isa_if_t {
 
        /**
         * Returns an 2-dim array of execution units, @p irn can be executed on.
-        * The first dimension is the type, the second the allowed units of this type.
+        * The first dimension is the type, the second the allowed units of this
+        * type.
         * Each dimension is a NULL terminated list.
         * @param self  The isa object.
         * @param irn   The node.
@@ -495,10 +533,10 @@ struct arch_isa_if_t {
 
        /**
         * Return an ordered list of irgs where code should be generated for.
-         * If NULL is returned, all irg will be taken into account and they will be
-         * generated in an arbitrary order.
+        * If NULL is returned, all irg will be taken into account and they will be
+        * generated in an arbitrary order.
         * @param self   The isa object.
-        * @param irgs   A flexible array ARR_F of length 0 where the backend cann append the desired irgs.
+        * @param irgs   A flexible array ARR_F of length 0 where the backend can append the desired irgs.
         * @return A flexible array ARR_F containing all desired irgs in the desired order.
         */
        ir_graph **(*get_backend_irg_list)(const void *self, ir_graph ***irgs);
@@ -538,4 +576,4 @@ struct arch_env_t {
  */
 #define arch_env_get_isa(env)   ((env)->isa)
 
-#endif
+#endif /* FIRM_BE_BEARCH_T_H */