renamed CMP to QSORT_CMP to avoid name clash
[libfirm] / ir / tv / tv.h
index 3fabedd..e4224e9 100644 (file)
@@ -288,16 +288,11 @@ extern tarval *tarval_b_true;
 /** Returns the mode_b tarval 'true'. */
 tarval *get_tarval_b_true(void);
 
-/** The 'void' pointer tarval. */
-extern tarval *tarval_P_void;
-/** Returns the 'void' pointer tarval. */
-tarval *get_tarval_P_void(void);
-
 /* These functions calculate and return a tarval representing the requested
  * value.
  * The functions get_mode_{Max,Min,...} return tarvals retrieved from these
  * functions, but these are stored on initialization of the irmode module and
- * therefore the irmode functions should be prefered to the functions below. */
+ * therefore the irmode functions should be preferred to the functions below. */
 
 /** Returns the maximum value of a given mode. */
 tarval *get_tarval_max(ir_mode *mode);
@@ -305,7 +300,8 @@ tarval *get_tarval_max(ir_mode *mode);
 /** Returns the minimum value of a given mode. */
 tarval *get_tarval_min(ir_mode *mode);
 
-/** Returns the 0 value (additive neutral) of a given mode. */
+/** Returns the 0 value (additive neutral) of a given mode.
+    For reference modes, the NULL value is returned (old tarval_P_void) */
 tarval *get_tarval_null(ir_mode *mode);
 
 /** Returns the 1 value (multiplicative neutral) of a given mode. */
@@ -385,7 +381,7 @@ pn_Cmp tarval_cmp(tarval *a, tarval *b);
  *    FIRM documentation for conversion rules
  *    mode_is_smaller defined in irmode.h
  */
-tarval *tarval_convert_to(tarval *src, ir_mode *m);
+tarval *tarval_convert_to(tarval *src, ir_mode *mode);
 
 /*
  * These function implement basic computations representable as opcodes
@@ -582,15 +578,23 @@ typedef enum _tarval_classification_t {
 
 /**
  * Identifying tarvals values for algebraic simplifications.
- * @param tv
+ *
+ * @param tv        the tarval
+ *
  * @return
- *   - TV_CLASSIFY_NULL    for additive neutral,
+ *   - TV_CLASSIFY_NULL    for additive neutral or the NULL tarval for reference modes,
  *   - TV_CLASSIFY_ONE     for multiplicative neutral,
  *   - TV_CLASSIFY_ALL_ONE for bitwise-and neutral
  *   - TV_CLASSIFY_OTHER   else
  */
 tarval_classification_t classify_tarval(tarval *tv);
 
+/**
+ * Returns non-zero if a given (integer) tarval has only one single bit
+ * set.
+ */
+int is_single_bit_tarval(tarval *tv);
+
 /**
  * Output of tarvals to a buffer.
  */