spill preparation needs liveness
[libfirm] / include / libfirm / irmode.h
index dfbbc75..16d6087 100644 (file)
@@ -23,7 +23,7 @@
  * @author  Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Mathias Heil,
  *          Michael Beck
  * @version $Id$
- * @summary
+ * @brief
  *  This module specifies the modes that type the firm nodes.  It defines
  *  a datasturcture that describes a mode and implements constructors and
  *  access routines to this datastructure. Further it defines a set of
 #define FIRM_IR_IRMODE_H
 
 #include "firm_types.h"
-#include "ident.h"
 
 /* ********** Predefined modes ********** */
 
-/**
- * Predefined mode according to tech report 1999-14.
- */
-typedef enum ir_modecode { /* irm is short for `ir mode' */
-       irm_BB,                       /**< basic block */
-       irm_X,                        /**< execution */
-       irm_F,                        /**< float(32) */
-       irm_D,                        /**< double(64) */
-       irm_E,                        /**< extended(80) */
-       irm_Bs,                       /**< signed byte(8) */
-       irm_Bu,                       /**< unsigned byte(8) */
-       irm_Hs,                       /**< signed short(16) */
-       irm_Hu,                       /**< unsigned short(16) */
-       irm_Is,                       /**< signed int(32) */
-       irm_Iu,                       /**< unsigned int(32) */
-       irm_Ls,                       /**< signed long(64) */
-       irm_Lu,                       /**< unsigned long(64) */
-       irm_LLs,                      /**< signed long long(128) */
-       irm_LLu,                      /**< unsigned long long(128) */
-       irm_P,                        /**< pointer */
-       irm_b,                        /**< internal boolean */
-       irm_M,                        /**< memory */
-       irm_T,                        /**< tuple */
-       irm_ANY,                      /**< undefined mode */
-       irm_BAD,                      /**< bad mode */
-       irm_max                       /**< maximum value for ir_modecode */
-} ir_modecode;
-
 /** Helper values for ir_mode_sort. */
 enum ir_mode_sort_helper {
        irmsh_is_num   = 0x10, /**< mode represents a number */
@@ -85,7 +56,7 @@ typedef enum ir_mode_sort {
        /* Predefined sorts of modes */
        irms_auxiliary        = 0, /**< Only for Firm use. Not extensible. (irm_T) */
        irms_control_flow     = 1, /**< Marks all control flow modes. Not extensible. (irm_BB, irm_X) */
-       irms_memory           = 2, /**< Marks the memory mode.  Not extensible. (irm_M) */
+       irms_memory           = 2 | irmsh_is_dataM, /**< Marks the memory mode.  Not extensible. (irm_M) */
 
        /** Internal boolean representation.
             Storing to memory impossible, convert first. (irm_b) */
@@ -124,6 +95,8 @@ typedef enum ir_mode_arithmetic {
        irma_max
 } ir_mode_arithmetic;
 
+/** Returns the name of the arithmetic type. */
+const char *get_mode_arithmetic_name(ir_mode_arithmetic ari);
 
 /* ********** Constructor for user defined modes **************** */
 /**
@@ -184,13 +157,10 @@ ir_mode *new_ir_vector_mode(const char *name, ir_mode_sort sort, int bit_size, u
  * @return
  *     true if the thing is a mode, else false
  */
-int is_mode(void *thing);
+int is_mode(const void *thing);
 
 /* ********** Access methods to read mode information *********** */
 
-/** Returns the classification of the mode */
-ir_modecode get_mode_modecode(const ir_mode *mode);
-
 /** Returns the ident* of the mode */
 ident      *get_mode_ident(const ir_mode *mode);
 
@@ -382,7 +352,7 @@ void set_modeP_data(ir_mode *p);
 
 /*@{*/
 /**
-   Functions to check, whether a ir_modecode is signed, float, int, character,
+   Functions to check, whether a mode is signed, float, int, character,
    reference, num, data, datab or dataM.
 
    For more exact definitions read the corresponding pages