ia32: Use a more logical specification of operand sizes in the binary emitter.
[libfirm] / ir / be / betranshlp.h
index f31f05f..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.
@@ -48,6 +47,12 @@ ir_node *be_pre_transform_node(ir_node *place);
  */
 ir_node *be_transform_node(ir_node *node);
 
+/**
+ * Creates a new phi (needs some special handling since we can't transform
+ * all predecessors yet).
+ */
+ir_node *be_transform_phi(ir_node *node, const arch_register_req_t *req);
+
 /**
  * Duplicate all dependency edges of a node.
  */
@@ -85,4 +90,20 @@ void be_enqueue_preds(ir_node *node);
  */
 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