remove firmnet and ycomp remote support (avoid unnecesary/complicated dependencies...
[libfirm] / include / libfirm / ircons.h
index 2626b5a..2ffb820 100644 (file)
  *    ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity,
  *                         ir_node **in, ir_entity *ent);
  *    ir_node *new_Call   (ir_node *store, ir_node *callee, int arity,
- *                 ir_node **in, type_method *type);
+ *                         ir_node **in, type_method *type);
+ *    ir_node *new_Builtin(ir_node *store, ir_builtin_kind kind, int arity,
+ *                         ir_node **in, type_method *type);
  *    ir_node *new_Add    (ir_node *op1, ir_node *op2, ir_mode *mode);
  *    ir_node *new_Sub    (ir_node *op1, ir_node *op2, ir_mode *mode);
  *    ir_node *new_Minus  (ir_node *op,  ir_mode *mode);
  *    ir_node *new_Cast   (ir_node *op, ir_type *to_tp);
  *    ir_node *new_Carry  (ir_node *op1, ir_node *op2, ir_mode *mode);
  *    ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode);
- *    ir_node *new_Load   (ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
- *    ir_node *new_Store  (ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
+ *    ir_node *new_Load   (ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags);
+ *    ir_node *new_Store  (ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags);
  *    ir_node *new_Alloc  (ir_node *store, ir_node *size, ir_type *alloc_type,
  *                         where_alloc where);
  *    ir_node *new_Free   (ir_node *store, ir_node *ptr, ir_node *size,
  *      A tuple containing the eventually changed store and the procedure
  *      results.
  *    Attributes:
- *      attr.call        Contains the type information for the procedure.
+ *      attr.call        Contains the attributes for the procedure.
  *
+ *    ir_node *new_Builtin(ir_node *store, ir_builtin_kind kind, int arity, ir_node **in,
+ *    -----------------------------------------------------------------------------------
+ *                       type_method *type)
+ *                       ------------------
+ *
+ *    Creates a builtin call.
+ *
+ *    Parameters
+ *      *store           The actual store.
+ *      kind             Describes the called builtin.
+ *      arity            The number of procedure parameters.
+ *      **in             An array with the pointers to the parameters.
+ *                       The constructor copies this array.
+ *      *type            Type information of the procedure called.
+ *
+ *    Inputs:
+ *      The store, the kind and the parameters.
+ *    Output:
+ *      A tuple containing the eventually changed store and the procedure
+ *      results.
+ *    Attributes:
+ *      attr.builtin     Contains the attributes for the called builtin.
  *
  *    ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode)
  *    ------------------------------------------------------------
  *      The definition valid in this block.
  *
  *    ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode)
- *    -----------------------------------------------------------------------------
+ *    -----------------------------------------------------------------------------------
  *
  *    Creates a Mux node. This node implements the following semantic:
  *    If the sel node (which must be of mode_b) evaluates to true, its value is
  *    OPERATIONS TO MANAGE MEMORY EXPLICITLY
  *    --------------------------------------
  *
- *    ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags)
- *    ----------------------------------------------------------------
+ *    ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags)
+ *    -------------------------------------------------------------------------------------
  *
  *    The Load operation reads a value from memory.
  *
  *      A tuple of the memory, a control flow to be taken in case of
  *      an exception and the loaded value.
  *
- *    ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val, cons_flags flags)
- *    ----------------------------------------------------------------
+ *    ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags)
+ *    -------------------------------------------------------------------------------------
  *
  *    The Store operation writes a value to a variable in memory.
  *
 
 #include "firm_types.h"
 
-typedef enum cons_flags {
-       cons_none      = 0,
-       cons_volatile  = 1U << 0,
-       cons_unaligned = 1U << 1,
-       cons_floats    = 1U << 2
-} cons_flags;
+/**
+ * constrained flags for memory operations.
+ */
+typedef enum ir_cons_flags {
+       cons_none      = 0,        /**< No constrains. */
+       cons_volatile  = 1U << 0,  /**< Memory operation is volatile. */
+       cons_unaligned = 1U << 1,  /**< Memory operation is unaligned. */
+       cons_floats    = 1U << 2   /**< Memory operation can float. */
+} ir_cons_flags;
 
 /*-------------------------------------------------------------------------*/
 /* The raw interface                                                       */
@@ -1419,7 +1446,7 @@ ir_node *new_rd_Sel    (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *st
 
 /** Constructor for a Call node.
  *
- *  Represents all kinds of method and function calls.
+ * Represents all kinds of method and function calls.
  *
  * @param   *db     A pointer for debug information.
  * @param   *irg    The IR graph the node  belongs to.
@@ -1433,6 +1460,22 @@ ir_node *new_rd_Sel    (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *st
 ir_node *new_rd_Call   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
                                    ir_node *callee, int arity, ir_node *in[], ir_type *tp);
 
+/** Constructor for a ´Builtin node.
+ *
+ * Represents a call of a backend-specific builtin..
+ *
+ * @param   *db     A pointer for debug information.
+ * @param   *irg    The IR graph the node  belongs to.
+ * @param   *block  The IR block the node belongs to.
+ * @param   *store  The current memory state.
+ * @param   arity   The number of procedure parameters.
+ * @param   *in[]   An array with the procedure parameters. The constructor copies this array.
+ * @param   kind    The kind of the called builtin.
+ * @param   *tp     Type information of the procedure called.
+ */
+ir_node *new_rd_Builtin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
+                                   int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
+
 /** Constructor for a Add node.
  *
  * @param   *db    A pointer for debug information.
@@ -1691,6 +1734,17 @@ ir_node *new_rd_Rotl    (dbg_info *db, ir_graph *irg, ir_node *block,
 ir_node *new_rd_Conv   (dbg_info *db, ir_graph *irg, ir_node *block,
                ir_node *op, ir_mode *mode);
 
+/** Constructor for a strictConv node.
+ *
+ * @param   *db    A pointer for debug information.
+ * @param   *irg   The IR graph the node  belongs to.
+ * @param   *block The IR block the node belongs to.
+ * @param   *op    The operand.
+ * @param   *mode  The mode of this the operand muss be converted .
+ */
+ir_node *new_rd_strictConv   (dbg_info *db, ir_graph *irg, ir_node *block,
+               ir_node *op, ir_mode *mode);
+
 /** Constructor for a Cast node.
  *
  * High level type cast.
@@ -1751,7 +1805,7 @@ ir_node *new_rd_Phi    (dbg_info *db, ir_graph *irg, ir_node *block, int arity,
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
 ir_node *new_rd_Load   (dbg_info *db, ir_graph *irg, ir_node *block,
-                       ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags);
+                       ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -1764,7 +1818,7 @@ ir_node *new_rd_Load   (dbg_info *db, ir_graph *irg, ir_node *block,
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
 ir_node *new_rd_Store  (dbg_info *db, ir_graph *irg, ir_node *block,
-               ir_node *store, ir_node *adr, ir_node *val, cons_flags flags);
+               ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -1894,7 +1948,7 @@ ir_node *new_rd_Confirm (dbg_info *db, ir_graph *irg, ir_node *block,
  * @param *irg    The IR graph the node  belongs to.
  * @param *m      The mode of the unknown value.
  */
-ir_node *new_rd_Unknown(ir_graph *irg, ir_mode *m);
+ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m);
 
 /** Constructor for a CallBegin node.
  *
@@ -1908,7 +1962,7 @@ ir_node *new_rd_Unknown(ir_graph *irg, ir_mode *m);
  * @param *block  The block the node belong to.
  * @param *callee The call node visible in the intra procedural view.
  */
-ir_node *new_rd_CallBegin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *callee);
+ir_node *new_rd_CallBegin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *ptr, ir_node *call);
 
 /** Constructor for a EndReg node.
  *
@@ -2247,7 +2301,7 @@ ir_node *new_r_Sel    (ir_graph *irg, ir_node *block, ir_node *store,
 
 /** Constructor for a Call node.
  *
- *  Represents all kinds of method and function calls.
+ * Represents all kinds of method and function calls.
  *
  * @param   *irg    The IR graph the node  belongs to.
  * @param   *block  The IR block the node belongs to.
@@ -2258,8 +2312,22 @@ ir_node *new_r_Sel    (ir_graph *irg, ir_node *block, ir_node *store,
  * @param   *tp     Type information of the procedure called.
  */
 ir_node *new_r_Call   (ir_graph *irg, ir_node *block, ir_node *store,
-               ir_node *callee, int arity, ir_node *in[],
-               ir_type *tp);
+                       ir_node *callee, int arity, ir_node *in[], ir_type *tp);
+
+/** Constructor for a Builtin node.
+ *
+ * Represents a call of a backend-specific builtin..
+ *
+ * @param   *irg    The IR graph the node  belongs to.
+ * @param   *block  The IR block the node belongs to.
+ * @param   *store  The actual store.
+ * @param   arity   The number of procedure parameters.
+ * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
+ * @param   kind    The kind of the called builtin.
+ * @param   *tp     Type information of the procedure called.
+ */
+ir_node *new_r_Builtin(ir_graph *irg, ir_node *block, ir_node *store,
+                       int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
 
 /** Constructor for a Add node.
  *
@@ -2499,6 +2567,16 @@ ir_node *new_r_Rotl   (ir_graph *irg, ir_node *block,
 ir_node *new_r_Conv   (ir_graph *irg, ir_node *block,
                ir_node *op, ir_mode *mode);
 
+/** Constructor for a strict Conv node.
+ *
+ * @param   *irg   The IR graph the node  belongs to.
+ * @param   *block The IR block the node belongs to.
+ * @param   *op    The operand.
+ * @param   *mode  The mode of this the operand muss be converted .
+ */
+ir_node *new_r_strictConv   (ir_graph *irg, ir_node *block,
+               ir_node *op, ir_mode *mode);
+
 /** Constructor for a Cast node.
  *
  * High level type cast
@@ -2555,7 +2633,7 @@ ir_node *new_r_Phi    (ir_graph *irg, ir_node *block, int arity,
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
 ir_node *new_r_Load   (ir_graph *irg, ir_node *block,
-               ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags);
+               ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -2567,7 +2645,7 @@ ir_node *new_r_Load   (ir_graph *irg, ir_node *block,
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
 ir_node *new_r_Store  (ir_graph *irg, ir_node *block,
-                      ir_node *store, ir_node *adr, ir_node *val, cons_flags flags);
+                      ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -2712,7 +2790,7 @@ ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m);
  * @param *block  The block the node belong to.
  * @param *callee The call node visible in the  intra procedural view.
  */
-ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *callee);
+ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *ptr, ir_node *call);
 
 /** Constructor for a EndReg node.
  *
@@ -2721,7 +2799,7 @@ ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *callee);
  * @param *irg    The IR graph the node belong to.
  * @param *block  The block the node belong to.
  */
-ir_node *new_r_EndReg (ir_graph *irg, ir_node *block);
+ir_node *new_r_EndReg(ir_graph *irg, ir_node *block);
 
 /** Constructor for a EndExcept node.
  *
@@ -3070,8 +3148,8 @@ ir_node *new_d_Sel    (dbg_info *db, ir_node *store, ir_node *objptr, int arity,
 
 /** Constructor for a Call node.
  *
- *  Represents all kinds of method and function calls.
- *  Adds the node to the block in current_ir_block.
+ * Represents all kinds of method and function calls.
+ * Adds the node to the block in current_ir_block.
  *
  * @param   *db     A pointer for debug information.
  * @param   *store  The actual store.
@@ -3081,7 +3159,21 @@ ir_node *new_d_Sel    (dbg_info *db, ir_node *store, ir_node *objptr, int arity,
  * @param   *tp     Type information of the procedure called.
  */
 ir_node *new_d_Call   (dbg_info *db, ir_node *store, ir_node *callee, int arity, ir_node *in[],
-             ir_type *tp);
+                       ir_type *tp);
+
+/** Constructor for a Builtin node.
+ *
+ * Represents a call of a backend-specific builtin..
+ * Adds the node to the block in current_ir_block.
+ *
+ * @param   *db     A pointer for debug information.
+ * @param   *store  The actual store.
+ * @param   arity   The number of procedure parameters.
+ * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
+ * @param   kind    The kind of the called builtin.
+ * @param   *tp     Type information of the procedure called.
+ */
+ir_node *new_d_Builtin(dbg_info *db, ir_node *store, int arity, ir_node *in[], ir_builtin_kind kind, ir_type *tp);
 
 /** Constructor for a Add node.
  *
@@ -3383,7 +3475,7 @@ ir_node *new_d_Phi    (dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
  * @param *mode  The mode of the value to be loaded.
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
-ir_node *new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
+ir_node *new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -3395,7 +3487,7 @@ ir_node *new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode,
  * @param *val   The value to write to this variable.
  * @param  flags Additional flags for alignment, volatility and pin state.
  */
-ir_node *new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
+ir_node *new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -3510,7 +3602,7 @@ ir_node *new_d_Confirm (dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp);
  *
  * @param *m      The mode of the unknown value.
  */
-ir_node *new_d_Unknown(ir_mode *m);
+ir_node *new_d_Unknown(dbg_info *db, ir_mode *m);
 
 /** Constructor for a CallBegin node.
  *
@@ -3522,7 +3614,7 @@ ir_node *new_d_Unknown(ir_mode *m);
  * @param *db     A pointer for debug information.
  * @param *callee The call node visible in the  intra procedural view.
  */
-ir_node *new_d_CallBegin(dbg_info *db, ir_node *callee);
+ir_node *new_d_CallBegin(dbg_info *db, ir_node *ptr, ir_node *call);
 
 /** Constructor for an EndReg node.
  *
@@ -3881,8 +3973,8 @@ ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity, ir_node *in[],
 
 /** Constructor for a Call node.
  *
- *  Adds the node to the block in current_ir_block.
- *  Represents all kinds of method and function calls.
+ * Adds the node to the block in current_ir_block.
+ * Represents all kinds of method and function calls.
  *
  * @param   *store  The actual store.
  * @param   *callee A pointer to the called procedure.
@@ -3893,6 +3985,20 @@ ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity, ir_node *in[],
 ir_node *new_Call   (ir_node *store, ir_node *callee, int arity, ir_node *in[],
                      ir_type *tp);
 
+/** Constructor for a Builtin node.
+ *
+ * Represents a call of a backend-specific builtin..
+ * Represents all kinds of method and function calls.
+ *
+ * @param   *store  The actual store.
+ * @param   kind    The kind of the called builtin.
+ * @param   arity   The number of procedure parameters.
+ * @param   *in[]   An array with the pointers to the parameters. The constructor copies this array.
+ * @param   *tp     Type information of the procedure called.
+ */
+ir_node *new_Builtin(ir_node *store, int arity, ir_node *in[],
+                     ir_builtin_kind kind, ir_type *tp);
+
 /** Constructor for a CallBegin node.
  *
  * CallBegin represents control flow depending of the pointer value
@@ -3902,7 +4008,7 @@ ir_node *new_Call   (ir_node *store, ir_node *callee, int arity, ir_node *in[],
  *
  * @param   *callee A pointer to the called procedure.
  */
-ir_node *new_CallBegin(ir_node *callee);
+ir_node *new_CallBegin(ir_node *ptr, ir_node *call);
 
 /** Constructor for a Add node.
  *
@@ -4170,7 +4276,7 @@ ir_node *new_Phi    (int arity, ir_node *in[], ir_mode *mode);
  * @param *mode   The mode of the value to be loaded.
  * @param  flags  Additional flags for alignment, volatility and pin state.
  */
-ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
+ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -4179,7 +4285,7 @@ ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags
  * @param *val    The value to write to this variable.
  * @param  flags  Additional flags for alignment, volatility and pin state.
  */
-ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
+ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -4395,6 +4501,16 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
                  int n_outs, ir_asm_constraint *outputs,
                  int n_clobber, ident *clobber[], ident *asm_text);
 
+/** Constructor for a Dummy node.
+ *
+ * @param *mode     The mode of the node.
+ */
+ir_node *new_Dummy(ir_mode *mode);
+
+ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode);
+
+ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
+
 /*---------------------------------------------------------------------*/
 /* The comfortable interface.                                          */
 /* Supports automatic Phi node construction.                           */