ia32: Use a more logical specification of operand sizes in the binary emitter.
[libfirm] / ir / be / betranshlp.h
index e0be48a..a45e2e8 100644 (file)
  * @brief       be transform helper extracted from the ia32 backend.
  * @author      Matthias Braun, Michael Beck
  * @date        14.06.2007
- * @version     $Id$
  */
 #ifndef FIRM_BE_BETRANSHLP_H
 #define FIRM_BE_BETRANSHLP_H
 
+#include "be_types.h"
 #include "firm_types.h"
-#include "beirg.h"
 
 /**
  * A callback to pre-transform some nodes before the transformation starts.
@@ -49,21 +48,28 @@ ir_node *be_pre_transform_node(ir_node *place);
 ir_node *be_transform_node(ir_node *node);
 
 /**
- * Duplicate all dependency edges of a node.
+ * Creates a new phi (needs some special handling since we can't transform
+ * all predecessors yet).
  */
-void be_duplicate_deps(ir_node *old_node, ir_node *new_node);
+ir_node *be_transform_phi(ir_node *node, const arch_register_req_t *req);
 
 /**
- * Depend on the frame if the node is in the start block.  This prevents
- * nodes being scheduled before they can be spilled.
+ * Duplicate all dependency edges of a node.
  */
-void be_dep_on_frame(ir_node *node);
+void be_duplicate_deps(ir_node *old_node, ir_node *new_node);
 
 /**
  * Duplicate a node during transformation.
  */
 ir_node *be_duplicate_node(ir_node *node);
 
+/** clear transform functions and sets some virtual nodes like
+ * Start, Sync, Pin to the duplication transformer */
+void be_start_transform_setup(void);
+
+/** register a transform function for a specific node type */
+void be_set_transform_function(ir_op *op, be_transform_func func);
+
 /**
  * Associate an old node with a transformed node. Uses link field.
  */
@@ -82,6 +88,22 @@ void be_enqueue_preds(ir_node *node);
 /**
  * Transform a graph. Transformers must be registered first.
  */
-void be_transform_graph(be_irg_t *birg, arch_pretrans_nodes *func);
+void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func);
+
+typedef bool (*upper_bits_clean_func)(const ir_node *node, ir_mode *mode);
+
+/**
+ * register a test function for be_upper_bits_clean for a specific node
+ * type.
+ */
+void be_set_upper_bits_clean_function(ir_op *op, upper_bits_clean_func func);
+
+/**
+ * returns true if it is assured, that the upper bits of a node are "clean"
+ * which means for a 16 or 8 bit value, that the upper bits in the register
+ * are 0 for unsigned and a copy of the last significant bit for signed
+ * numbers.
+ */
+bool be_upper_bits_clean(const ir_node *node, ir_mode *mode);
 
-#endif /* FIRM_BE_BETRANSHLP_H */
+#endif