* Optimization flags.
*/
typedef enum {
- arch_dep_none = 0,
- arch_dep_mul_to_shift = 1
+ arch_dep_none = 0,
+ arch_dep_mul_to_shift = 1, /**< optimize Mul into Shift/Add/Sub */
+ arch_dep_div_to_shift = 2 /**< optimize Div into Shift/Add/Mul */
} arch_dep_opts_t;
/**
*/
ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn);
+/**
+ * Replace Divs with Shifts and Add/Subs.
+ * This function is driven by the 3 parameters:
+ * - also_use_subs
+ * - maximum_shifts
+ * - highest_shift_amount
+ *
+ * If irn is a Div with a Const, The constant is inspected, if it meets the
+ * requirements of the three variables stated above. If a Shl/Add/Sub
+ * sequence can be generated, that meets these requirements, this expression
+ * is returned. In each other case, irn is returned unmodified.
+ *
+ * @param irn The Firm node to inspect.
+ * @return A replacement expression for irn.
+ */
+ir_node *arch_dep_replace_div_with_shifts(ir_node *irn);
+
#endif