- Fix some more stuff in ir_spec.py
[libfirm] / include / libfirm / ircons.h
index 867d73b..69362c7 100644 (file)
  *    set_cur_block(block).  If several blocks are constructed in parallel block
  *    switches need to be performed constantly.
  *
- *    To generate a Block node (with the comfortable interface) it's predecessor
+ *    To generate a Block node (with the comfortable interface), its predecessor
  *    control flow nodes need not be known.  In case of cyclic control flow these
  *    can not be known when the block is constructed.  With add_immBlock_pred(block,
  *    cfnode) predecessors can be added to the block.  If all predecessors are
  *    ir_node *new_IJmp     (ir_node *tgt);
  *    ir_node *new_Cond     (ir_node *c);
  *    ir_node *new_Return   (ir_node *store, int arity, ir_node **in);
- *    ir_node *new_Const    (ir_mode *mode, tarval *con);
+ *    ir_node *new_Const    (tarval *con);
  *    ir_node *new_SymConst (ir_mode *mode, symconst_symbol value, symconst_kind kind);
  *    ir_node *new_simpleSel (ir_node *store, ir_node *objptr, ir_entity *ent);
  *    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_Shl    (ir_node *op,  ir_node *k,   ir_mode *mode);
  *    ir_node *new_Shr    (ir_node *op,  ir_node *k,   ir_mode *mode);
  *    ir_node *new_Shrs   (ir_node *op,  ir_node *k,   ir_mode *mode);
- *    ir_node *new_Rot    (ir_node *op,  ir_node *k,   ir_mode *mode);
+ *    ir_node *new_Rotl   (ir_node *op,  ir_node *k,   ir_mode *mode);
  *    ir_node *new_Cmp    (ir_node *op1, ir_node *op2);
  *    ir_node *new_Conv   (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);
- *    ir_node *new_Store  (ir_node *store, ir_node *addr, ir_node *val);
+ *    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,
  *    ir_node *new_Proj   (ir_node *arg, ir_mode *mode, long proj);
  *    ir_node *new_NoMem  (void);
  *    ir_node *new_Mux    (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
- *    ir_node *new_Psi    (int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode);
  *    ir_node *new_CopyB  (ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type);
  *    ir_node *new_InstOf (ir_node *store, ir_node obj, ir_type *ent);
  *    ir_node *new_Raise  (ir_node *store, ir_node *obj);
  *    ir_node *new_immBlock (void)
  *    ----------------------------
  *
- *    Creates a new block.  Sets current_block to itself.  When a new block is
- *    created it cannot be known how many predecessors this block will have in the
- *    control flow graph. Therefore the list of inputs can not be fixed at
- *    creation.  Predecessors can be added with add_immBlock_pred (block, control flow
- *    operation).  With every added predecessor the number of inputs to Phi nodes
- *    also changes.
+ *    Creates a new block. When a new block is created it cannot be known how
+ *    many predecessors this block will have in the control flow graph.
+ *    Therefore the list of inputs can not be fixed at creation.  Predecessors
+ *    can be added with add_immBlock_pred (block, control flow operation).
+ *    With every added predecessor the number of inputs to Phi nodes also
+ *    changes.
  *
  *    The block can be completed by mature_immBlock(block) if all predecessors are
  *    known.  If several blocks are built at once, mature_immBlock can only be called
  *    Example for faulty IR construction:  (draw the graph on a paper and you'll
  *                                          get it ;-)
  *
- *      block_before_loop = new_block();
+ *      block_before_loop = new_immBlock();
+ *      set_cur_block(block_before_loop);
  *      set_value(x);
  *      mature_immBlock(block_before_loop);
  *      before2header = new_Jmp;
  *
- *      loop_header = new_block ();
+ *      loop_header = new_immBlock ();
+ *      set_cur_block(loop_header);
  *      header2body - new_Jmp();
  *
- *      loop_body = new_block ();
+ *      loop_body = new_immBlock ();
+ *      set_cur_block(loop_body);
  *      body2header = new_Jmp();
  *
  *      add_immBlock_pred(loop_header, before2header);
  *
  *    ---------
  *
- *    ir_node *new_Const (ir_mode *mode, tarval *con)
+ *    ir_node *new_Const (tarval *con)
  *    -----------------------------------------------
  *
  *    Creates a constant in the constant table and adds a Const node
- *    returning this value to the start block.
+ *    returning this value to the start block. The mode is derived
+ *    from the tarval.
  *
  *    Parameters:
- *      *mode            The mode of the constant.
  *      *con             Points to an entry in the constant table.
  *                       This pointer is added to the attributes of
  *                       the node (self->attr.con)
  *      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)
  *    ------------------------------------------------------------
  *
  *    Arithmetic shift right, i.e., sign extended.
  *
- *    ir_node *new_Rot (ir_node *op, ir_node *k, ir_mode *mode)
+ *    ir_node *new_Rotl (ir_node *op, ir_node *k, ir_mode *mode)
  *    ---------------------------------------------------------
  *
- *    Rotates the operand to the (right?) by k bits.
+ *    Rotates the operand to the left by k bits.
  *
  *    ir_node *new_Carry (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
  *    ir_true, else ir_false;
  *
  *
- *    ir_node *new_Psi (int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode)
- *    -----------------------------------------------------------------------------
- *
- *    Creates a Psi node. This node implements the following semantic:
- *    Enter it here!!!
- *
  *
  *    OPERATIONS TO MANAGE MEMORY EXPLICITLY
  *    --------------------------------------
  *
- *    ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode)
- *    ----------------------------------------------------------------
+ *    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.
  *
  *    *store        The current memory.
  *    *addr         A pointer to the variable to be read in this memory.
  *    *mode         The mode of the value to be loaded.
+ *     flags        Additional flags for alignment, volatility and pin state.
  *
  *    Inputs:
  *      The memory and a pointer to a variable in this 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)
- *    ----------------------------------------------------------------
+ *    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.
  *
 #ifndef FIRM_IR_IRCONS_H
 #define FIRM_IR_IRCONS_H
 
-#include "firm_common.h"
-#include "irnode.h"
-#include "irgraph.h"
+#include "firm_types.h"
+
+/**
+ * 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                                                       */
@@ -1216,7 +1245,7 @@ ir_node *new_rd_Cond   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *c)
 
 /** Constructor for a Return node.
  *
- * Returns the memory an zero or more return values.  Only node that
+ * Returns the memory and zero or more return values.  Only node that
  * can end regular control flow.
  *
  * @param *db    A pointer for debug information.
@@ -1230,34 +1259,51 @@ ir_node *new_rd_Return (dbg_info *db, ir_graph *irg, ir_node *block,
                        ir_node *store, int arity, ir_node *in[]);
 
 /** Constructor for a Const_type node.
+ *
+ * Adds the node to the start block.
  *
  * The constant represents a target value.  This constructor sets high
  * level type information for the constant value.
+ * Derives mode from passed tarval.
  *
  * @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 *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table.
  * @param *tp    The type of the constant.
  */
-ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg, ir_node *block,
-                            ir_mode *mode, tarval *con, ir_type *tp);
+ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg,
+                            tarval *con, ir_type *tp);
 
 /** Constructor for a Const node.
+ *
+ * Adds the node to the start block.
  *
  * Constructor for a Const node. The constant represents a target
  * value.  Sets the type information to type_unknown.  (No more
  * supported: If tv is entity derives a somehow useful type.)
+ * Derives mode from passed tarval.
  *
  * @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 *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table.
  */
-ir_node *new_rd_Const  (dbg_info *db, ir_graph *irg, ir_node *block,
-                        ir_mode *mode, tarval *con);
+ir_node *new_rd_Const  (dbg_info *db, ir_graph *irg, tarval *con);
+
+/** Constructor for a Const node.
+ *
+ * Adds the node to the start block.
+ *
+ * Constructor for a Const node. The constant represents a target
+ * value.  Sets the type information to type_unknown.  (No more
+ * supported: If tv is entity derives a somehow useful type.)
+ *
+ * @param *db    A pointer for debug information.
+ * @param *irg   The IR graph the node  belongs to.
+ * @param *mode  The mode of the operands and results.
+ * @param value  A value from which the tarval is made.
+ */
+ir_node *new_rd_Const_long (dbg_info *db, ir_graph *irg,
+                                   ir_mode *mode, long value);
 
 /** Constructor for a SymConst_type node.
  *
@@ -1400,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.
@@ -1414,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.
@@ -1515,6 +1577,20 @@ ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block,
 ir_node *new_rd_Div    (dbg_info *db, ir_graph *irg, ir_node *block,
                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
 
+/** Constructor for a remainderless Div 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   *memop The store needed to model exceptions
+ * @param   *op1   The first operand.
+ * @param   *op2   The second operand.
+ * @param   *mode  The mode of the result.
+ * @param   state  The pinned state.
+ */
+ir_node *new_rd_DivRL  (dbg_info *db, ir_graph *irg, ir_node *block,
+               ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+
 /** Constructor for a Mod node.
  *
  * @param   *db    A pointer for debug information.
@@ -1634,7 +1710,7 @@ ir_node *new_rd_Shr    (dbg_info *db, ir_graph *irg, ir_node *block,
 ir_node *new_rd_Shrs   (dbg_info *db, ir_graph *irg, ir_node *block,
                ir_node *op, ir_node *k, ir_mode *mode);
 
-/** Constructor for a Rot node.
+/** Constructor for a Rotl node.
  *
  * @param   *db    A pointer for debug information.
  * @param   *irg   The IR graph the node  belongs to.
@@ -1643,7 +1719,7 @@ ir_node *new_rd_Shrs   (dbg_info *db, ir_graph *irg, ir_node *block,
  * @param   *k     The number of bits to rotate the operand.
  * @param   *mode  The mode of the operand.
  */
-ir_node *new_rd_Rot    (dbg_info *db, ir_graph *irg, ir_node *block,
+ir_node *new_rd_Rotl    (dbg_info *db, ir_graph *irg, ir_node *block,
                ir_node *op, ir_node *k, ir_mode *mode);
 
 
@@ -1658,6 +1734,17 @@ ir_node *new_rd_Rot    (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.
@@ -1715,9 +1802,10 @@ ir_node *new_rd_Phi    (dbg_info *db, ir_graph *irg, ir_node *block, int arity,
  * @param *store The current memory
  * @param *adr   A pointer to the variable to be read in this memory.
  * @param *mode  The mode of the value to be loaded.
+ * @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);
+                       ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -1727,9 +1815,10 @@ ir_node *new_rd_Load   (dbg_info *db, ir_graph *irg, ir_node *block,
  * @param *store The current memory
  * @param *adr   A pointer to the variable to be read in this memory.
  * @param *val   The value to write to this variable.
+ * @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);
+               ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -1835,15 +1924,6 @@ ir_node *new_rd_Tuple  (dbg_info *db, ir_graph *irg, ir_node *block,
 ir_node *new_rd_Id     (dbg_info *db, ir_graph *irg, ir_node *block,
                        ir_node *val, ir_mode *mode);
 
-/** Constructor for a Bad node.
- *
- * Returns the unique Bad node of the graph.  The same as
- * get_irg_bad().
- *
- * @param *irg    The IR graph the node belongs to.
- */
-ir_node *new_rd_Bad    (ir_graph *irg);
-
 /** Constructor for a Confirm node.
  *
  * Specifies constraints for a value.  To support dataflow analyses.
@@ -1925,15 +2005,6 @@ ir_node *new_rd_EndExcept(dbg_info *db, ir_graph *irg, ir_node *block);
 ir_node *new_rd_Filter (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
                        ir_mode *mode, long proj);
 
-/** Constructor for a NoMem node.
- *
- * Returns the unique NoMem node of the graph.  The same as
- * get_irg_no_mem().
- *
- * @param *irg    The IR graph the node belongs to.
- */
-ir_node *new_rd_NoMem  (ir_graph *irg);
-
 /** Constructor for a Mux node.
  *
  * @param *db       A pointer for debug information.
@@ -1947,19 +2018,6 @@ ir_node *new_rd_NoMem  (ir_graph *irg);
 ir_node *new_rd_Mux  (dbg_info *db, ir_graph *irg, ir_node *block,
     ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
 
-/** Constructor for a Psi node.
- *
- * @param *db       A pointer for debug information.
- * @param *irg      The IR graph the node belong to.
- * @param *block    The block the node belong to.
- * @param *arity    The arity of the conditions
- * @param *conds    The array of mode_b conditions, length must be equal arity
- * @param *vals     The array of mode values, length must be equal arity + 1
- * @param *mode     The mode of the node (must be the mode of all vals).
- */
-ir_node *new_rd_Psi (dbg_info *db, ir_graph *irg, ir_node *block,
-                     int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode);
-
 /** Constructor for a CopyB node.
  *
  * @param *db         A pointer for debug information.
@@ -2115,7 +2173,7 @@ ir_node *new_r_Cond   (ir_graph *irg, ir_node *block, ir_node *c);
 
 /** Constructor for a Return node.
  *
- * Returns the memory an zero or more return values.  Only node that
+ * Returns the memory and zero or more return values.  Only node that
  * can end regular control flow.
  *
  * @param *irg   The IR graph the node  belongs to.
@@ -2128,46 +2186,48 @@ ir_node *new_r_Return (ir_graph *irg, ir_node *block,
                       ir_node *store, int arity, ir_node *in[]);
 
 /** Constructor for a Const node.
+ *
+ * Adds the node to the start block.
  *
  * Constructor for a Const node. The constant represents a target
  * value.  Sets the type information to type_unknown.  (No more
  * supported: If tv is entity derives a somehow useful type.)
+ * Derives mode from passed tarval.
  *
  * @param *irg   The IR graph the node  belongs to.
  * @param *block The IR block the node belongs to.
- * @param *mode  The mode of the operands and the results.
  * @param *con   Points to an entry in the constant table.
  */
-ir_node *new_r_Const  (ir_graph *irg, ir_node *block,
-                      ir_mode *mode, tarval *con);
+ir_node *new_r_Const  (ir_graph *irg, tarval *con);
 
 /** Constructor for a Const node.
+ *
+ * Adds the node to the start block.
  *
  * Constructor for a Const node. The constant represents a target
  * value.  Sets the type information to type_unknown.  (No more
  * supported: If tv is entity derives a somehow useful type.)
  *
  * @param *irg   The IR graph the node  belongs to.
- * @param *block The IR block the node belongs to.
  * @param *mode  The mode of the operands and the results.
  * @param value  A value from which the tarval is made.
  */
-ir_node *new_r_Const_long(ir_graph *irg, ir_node *block,
+ir_node *new_r_Const_long(ir_graph *irg,
                       ir_mode *mode, long value);
 
 /** Constructor for a Const_type node.
+ *
+ * Adds the node to the start block.
  *
  * The constant represents a target value.  This constructor sets high
  * level type information for the constant value.
+ * Derives mode from passed tarval.
  *
  * @param *irg   The IR graph the node  belongs to.
- * @param *block The IR block the node belongs to.
- * @param *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table.
  * @param *tp    The type of the constant.
  */
-ir_node *new_r_Const_type(ir_graph *irg, ir_node *block,
-           ir_mode *mode, tarval *con, ir_type *tp);
+ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp);
 
 /** Constructor for a SymConst node.
  *
@@ -2241,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.
@@ -2252,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.
  *
@@ -2349,6 +2423,19 @@ ir_node *new_r_DivMod (ir_graph *irg, ir_node *block,
 ir_node *new_r_Div    (ir_graph *irg, ir_node *block,
                ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
 
+/** Constructor for a remainderless Div node.
+ *
+ * @param   *irg   The IR graph the node  belongs to.
+ * @param   *block The IR block the node belongs to.
+ * @param   *memop The store needed to model exceptions
+ * @param   *op1   The first operand.
+ * @param   *op2   The second operand.
+ * @param   *mode  The mode of the result.
+ * @param   state  The pinned state.
+ */
+ir_node *new_r_DivRL  (ir_graph *irg, ir_node *block,
+               ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+
 /** Constructor for a Mod node.
  *
  * @param   *irg   The IR graph the node  belongs to.
@@ -2459,7 +2546,7 @@ ir_node *new_r_Shr    (ir_graph *irg, ir_node *block,
 ir_node *new_r_Shrs   (ir_graph *irg, ir_node *block,
                ir_node *op, ir_node *k, ir_mode *mode);
 
-/** Constructor for a Rot node.
+/** Constructor for a Rotl node.
  *
  * @param   *irg   The IR graph the node  belongs to.
  * @param   *block The IR block the node belongs to.
@@ -2467,7 +2554,7 @@ ir_node *new_r_Shrs   (ir_graph *irg, ir_node *block,
  * @param   *k     The number of bits to rotate the operand.
  * @param   *mode  The mode of the operand.
  */
-ir_node *new_r_Rot    (ir_graph *irg, ir_node *block,
+ir_node *new_r_Rotl   (ir_graph *irg, ir_node *block,
                ir_node *op, ir_node *k, ir_mode *mode);
 
 /** Constructor for a Conv node.
@@ -2480,6 +2567,16 @@ ir_node *new_r_Rot    (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
@@ -2533,9 +2630,10 @@ ir_node *new_r_Phi    (ir_graph *irg, ir_node *block, int arity,
  * @param *store The current memory
  * @param *adr   A pointer to the variable to be read in this memory.
  * @param *mode  The mode of the value to be loaded.
+ * @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);
+               ir_node *store, ir_node *adr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
@@ -2544,9 +2642,10 @@ ir_node *new_r_Load   (ir_graph *irg, ir_node *block,
  * @param *store The current memory
  * @param *adr   A pointer to the variable to be read in this memory.
  * @param *val   The value to write to this variable.
+ * @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);
+                      ir_node *store, ir_node *adr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -2764,18 +2863,6 @@ ir_node *new_r_NoMem  (ir_graph *irg);
 ir_node *new_r_Mux  (ir_graph *irg, ir_node *block,
     ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
 
-/** Constructor for a Psi node.
- *
- * @param *irg      The IR graph the node belong to.
- * @param *block    The block the node belong to.
- * @param *arity    The arity of the conditions
- * @param *conds    The array of mode_b conditions, length must be equal arity
- * @param *vals     The array of mode values, length must be equal arity + 1
- * @param *mode     The mode of the node (must be the mode of all vals).
- */
-ir_node *new_r_Psi (ir_graph *irg, ir_node *block,
-                    int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode);
-
 /** Constructor for a CopyB node.
  *
  * @param *irg        The IR graph the node belong to.
@@ -2943,7 +3030,7 @@ ir_node *new_d_Cond   (dbg_info *db, ir_node *c);
  *
  * Adds the node to the block in current_ir_block.
  *
- * Returns the memory an zero or more return values.  Only node that
+ * Returns the memory and zero or more return values.  Only node that
  * can end regular control flow.
  *
  * @param *db    A pointer for debug information.
@@ -2955,18 +3042,18 @@ ir_node *new_d_Return (dbg_info *db, ir_node *store, int arity, ir_node *in[]);
 
 /** Constructor for a Const_type node.
  *
- * Adds the node to the block in current_ir_block.
+ * Adds the node to the start block.
  *
  * The constant represents a target value.  This constructor sets high
  * level type information for the constant value.
+ * Derives mode from passed tarval.
  *
  * @param *db    A pointer for debug information.
- * @param *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table. This pointer is
                  added to the attributes of the node.
  * @param *tp    The type of the constant.
  */
-ir_node *new_d_Const_type (dbg_info *db, ir_mode *mode, tarval *con, ir_type *tp);
+ir_node *new_d_Const_type (dbg_info *db, tarval *con, ir_type *tp);
 
 /** Constructor for a Const node.
  *
@@ -2975,13 +3062,13 @@ ir_node *new_d_Const_type (dbg_info *db, ir_mode *mode, tarval *con, ir_type *tp
  * Constructor for a Const node. The constant represents a target
  * value.  Sets the type information to type_unknown.  (No more
  * supported: If tv is entity derives a somehow useful type.)
+ * Derives mode from passed tarval.
  *
  * @param *db    A pointer for debug information.
- * @param *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table. This pointer is added
  *               to the attributes of the node.
  */
-ir_node *new_d_Const  (dbg_info *db, ir_mode *mode, tarval *con);
+ir_node *new_d_Const  (dbg_info *db, tarval *con);
 
 /** Constructor for a SymConst_type node.
  *
@@ -3061,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.
@@ -3072,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.
  *
@@ -3167,6 +3268,19 @@ ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2,
  */
 ir_node *new_d_Div    (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
 
+/** Constructor for a remainderless Div node.
+ *
+ * Adds the node to the block in current_ir_block.
+ *
+ * @param   *db    A pointer for debug information.
+ * @param   *memop The store needed to model exceptions
+ * @param   *op1   The first operand.
+ * @param   *op2   The second operand.
+ * @param   *mode  The mode of the result.
+ * @param   state  The pinned state.
+ */
+ir_node *new_d_DivRL  (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+
 /** Constructor for a Mod node.
  *
  * Adds the node to the block in current_ir_block.
@@ -3266,7 +3380,7 @@ ir_node *new_d_Shr    (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
  */
 ir_node *new_d_Shrs   (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
 
-/** Constructor for a Rot node.
+/** Constructor for a Rotl node.
  *
  * Adds the node to the block in current_ir_block.
  *
@@ -3275,7 +3389,7 @@ ir_node *new_d_Shrs   (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
  * @param   *k     The number of bits to rotate the operand.
  * @param   *mode  The mode of the operand.
  */
-ir_node *new_d_Rot    (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
+ir_node *new_d_Rotl   (dbg_info *db, ir_node *op,  ir_node *k,   ir_mode *mode);
 
 /** Constructor for a Cmp node.
  *
@@ -3359,8 +3473,9 @@ ir_node *new_d_Phi    (dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
  * @param *store The current memory
  * @param *addr  A pointer to the variable to be read in this memory.
  * @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);
+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.
  *
@@ -3370,8 +3485,9 @@ ir_node *new_d_Load   (dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mod
  * @param *store The current memory
  * @param *addr  A pointer to the variable to be read in this memory.
  * @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);
+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.
  *
@@ -3464,13 +3580,6 @@ ir_node *new_d_Tuple  (dbg_info *db, int arity, ir_node *in[]);
  */
 ir_node *new_d_Id     (dbg_info *db, ir_node *val, ir_mode *mode);
 
-/** Constructor for a Bad node.
- *
- * Returns the unique Bad node of the graph.  The same as
- * get_irg_bad().
- */
-ir_node *new_d_Bad    (void);
-
 /** Constructor for a Confirm node.
  *
  * Constructor for a Confirm node. Adds the node to the block in current_ir_block.
@@ -3557,14 +3666,6 @@ ir_node *new_d_Break (dbg_info *db);
  */
 ir_node *new_d_Filter (dbg_info *db, ir_node *arg, ir_mode *mode, long proj);
 
-
-/** Constructor for a NoMem node.
- *
- * Returns the unique NoMem node of the graph.  The same as
- * get_irg_no_mem().
- */
-ir_node *new_d_NoMem  (void);
-
 /** Constructor for a Mux node.
  *
  * @param *db       A pointer for debug information.
@@ -3576,17 +3677,6 @@ ir_node *new_d_NoMem  (void);
 ir_node *new_d_Mux  (dbg_info *db, ir_node *sel,
     ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
 
-/** Constructor for a Psi node.
- *
- * @param *db       A pointer for debug information.
- * @param *arity    The arity of the conditions
- * @param *conds    The array of mode_b conditions, length must be equal arity
- * @param *vals     The array of mode values, length must be equal arity + 1
- * @param *mode     The mode of the node (must be the mode of all vals).
- */
-ir_node *new_d_Psi (dbg_info *db,
-                    int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode);
-
 /** Constructor for a CopyB node.
  *
  * @param *db         A pointer for debug information.
@@ -3743,7 +3833,7 @@ ir_node *new_Cond   (ir_node *c);
 
 /** Constructor for a Return node.
  *
- * Returns the memory an zero or more return values.  Only node that
+ * Returns the memory and zero or more return values.  Only node that
  * can end regular control flow. Adds the node to the block in current_ir_block.
  *
  * @param *store The state of memory.
@@ -3758,12 +3848,12 @@ ir_node *new_Return (ir_node *store, int arity, ir_node *in[]);
  * value.  Sets the type information to type_unknown.  (No more
  * supported: If tv is entity derives a somehow useful type.)
  * Adds the node to the block in current_ir_block.
+ * Derives mode from passed tarval.
  *
- * @param *mode  The mode of the operands and results.
  * @param *con   Points to an entry in the constant table. This pointer is
  *               added to the attributes of  the node.
  */
-ir_node *new_Const  (ir_mode *mode, tarval *con);
+ir_node *new_Const (tarval *con);
 
 /**
  * Make a const from a long.
@@ -3780,7 +3870,7 @@ ir_node *new_Const_long(ir_mode *mode, long value);
 
 /** Constructor for a Const node.
  *
- * Derives mode from passed type. */
+ * Derives mode from passed tarval. */
 ir_node *new_Const_type(tarval *con, ir_type *tp);
 
 /** Constructor for a SymConst node.
@@ -3883,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.
@@ -3895,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
@@ -3989,6 +4093,18 @@ ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode,
  */
 ir_node *new_Div    (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
 
+/** Constructor for a remainderless Div node.
+ *
+ * Adds the node to the block in current_ir_block.
+ *
+ * @param   *memop The store needed to model exceptions
+ * @param   *op1   The first operand.
+ * @param   *op2   The second operand.
+ * @param   *mode  The mode of the result.
+ * @param   state  The pinned state.
+ */
+ir_node *new_DivRL  (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, op_pin_state state);
+
 /** Constructor for a Mod node.
  *
  * Adds the node to the block in current_ir_block.
@@ -4076,7 +4192,7 @@ ir_node *new_Shr    (ir_node *op,  ir_node *k,   ir_mode *mode);
  */
 ir_node *new_Shrs   (ir_node *op,  ir_node *k,   ir_mode *mode);
 
-/** Constructor for a Rot node.
+/** Constructor for a Rotl node.
  *
  * Adds the node to the block in current_ir_block.
  *
@@ -4084,7 +4200,7 @@ ir_node *new_Shrs   (ir_node *op,  ir_node *k,   ir_mode *mode);
  * @param   *k     The number of bits to rotate the operand.
  * @param   *mode  The mode of the operand.
  */
-ir_node *new_Rot    (ir_node *op,  ir_node *k,   ir_mode *mode);
+ir_node *new_Rotl   (ir_node *op,  ir_node *k,   ir_mode *mode);
 
 /** Constructor for a Cmp node.
  *
@@ -4158,16 +4274,18 @@ ir_node *new_Phi    (int arity, ir_node *in[], ir_mode *mode);
  * @param *store  The current memory.
  * @param *addr   A pointer to the variable to be read in this memory.
  * @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);
+ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags);
 
 /** Constructor for a Store node.
  *
  * @param *store  The current memory.
  * @param *addr   A pointer to the variable to be read in this memory.
  * @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);
+ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags);
 
 /** Constructor for a Alloc node.
  *
@@ -4318,15 +4436,6 @@ ir_node *new_NoMem  (void);
  */
 ir_node *new_Mux  (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode);
 
-/** Constructor for a Psi node.
- *
- * @param *arity    The arity of the conditions
- * @param *conds    The array of mode_b conditions, length must be equal arity
- * @param *vals     The array of mode values, length must be equal arity + 1
- * @param *mode     The mode of the node (must be the mode of all vals).
- */
-ir_node *new_Psi (int arity, ir_node *conds[], ir_node *vals[], ir_mode *mode);
-
 /** Constructor for a CopyB node.
  *
  * Adds the node to the block in current_ir_block.
@@ -4392,6 +4501,12 @@ 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);
+
 /*---------------------------------------------------------------------*/
 /* The comfortable interface.                                          */
 /* Supports automatic Phi node construction.                           */
@@ -4405,10 +4520,9 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
  * can be added with add_immBlock_pred().  Once all predecessors are
  * added the block must be matured.
  *
- * Adds the block to the graph in current_ir_graph. Does set
- * current_block.  Can be used with automatic Phi node construction.
- * This constructor can only be used if the graph is in
- * state_building.
+ * Adds the block to the graph in current_ir_graph. Can be used with automatic
+ * Phi node construction.
+ * This constructor can only be used if the graph is in state_building.
  */
 ir_node *new_d_immBlock(dbg_info *db);
 ir_node *new_immBlock(void);
@@ -4512,21 +4626,4 @@ void irp_finalize_cons(void);
 
 /* --- Initialization --- */
 
-/**
- * This function is called, whenever a local variable is used before definition
- *
- * @param irg       the IR graph on which this happens
- * @param mode      the mode of the local var
- * @param pos       position chosen be the frontend for this variable (n_loc)
- *
- * @return a firm node of mode @p mode that initializes the var at position pos
- *
- * @note
- *      Do not return NULL!
- *      If this function is not set, FIRM will create a const node with tarval BAD.
- *      Use set_irg_loc_description()/get_irg_loc_description() to assign additional
- *      informations to local variables.
- */
-typedef ir_node *uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos);
-
 #endif