add doxygen comments
[libfirm] / include / libfirm / tv.h
index f67edd7..a92175d 100644 (file)
@@ -250,6 +250,18 @@ int tarval_is_null(tarval *a);
  */
 int tarval_is_one(tarval *a);
 
+/**
+ * Returns 1 if tv is the "minus one"
+ *
+ * @param a the tarval
+ */
+int tarval_is_minus_one(tarval *a);
+
+/*
+ * returns non-zero if all bits in the tarval are set
+ */
+int tarval_is_all_one(tarval *tv);
+
 /** The 'bad' tarval. */
 extern tarval *tarval_bad;
 /** Returns the 'bad tarval. */
@@ -294,6 +306,10 @@ tarval *get_tarval_one(ir_mode *mode);
  *  Returns tarval bad for unsigned modes */
 tarval *get_tarval_minus_one(ir_mode *mode);
 
+/** returns the value where all bits are 1 of a given mode.
+ * returns tarval_bad for float modes */
+tarval *get_tarval_all_one(ir_mode *mode);
+
 /** Return quite nan for float_number modes. */
 tarval *get_tarval_nan(ir_mode *mode);
 
@@ -415,6 +431,9 @@ tarval *tarval_div(tarval *a, tarval *b);
 /** Remainder of integer division. */
 tarval *tarval_mod(tarval *a, tarval *b);
 
+/** Integer division AND remainder. */
+tarval *tarval_divmod(tarval *a, tarval *b, tarval **mod_res);
+
 /** Absolute value. */
 tarval *tarval_abs(tarval *a);
 
@@ -550,42 +569,70 @@ char *get_tarval_bitpattern(tarval *tv);
 unsigned char get_tarval_sub_bits(tarval *tv, unsigned byte_ofs);
 
 /**
- * Return values of tarval classify
+ * Returns non-zero if a given (integer) tarval has only one single bit
+ * set.
  */
-typedef enum _tarval_classification_t {
-  TV_CLASSIFY_NULL    =  0, /**< the tarval represents the additive neutral element */
-  TV_CLASSIFY_ONE     = +1, /**< the tarval represents the multiplicative neutral element */
-  TV_CLASSIFY_ALL_ONE = -1, /**< the tarval represents the bitwise-and neutral element */
-  TV_CLASSIFY_OTHER   =  2  /**< all other tarvals */
-} tarval_classification_t;
+int tarval_is_single_bit(tarval *tv);
 
 /**
- * Identifying tarvals values for algebraic simplifications.
- *
- * @param tv        the tarval
+ * Output of tarvals to a buffer.
+ */
+int tarval_snprintf(char *buf, size_t buflen, tarval *tv);
+
+/**
+ * Output of tarvals to stdio.
+ */
+int tarval_printf(tarval *tv);
+
+/**
+ * Returns non-zero if the mantissa of a floating point IEEE-754
+ * tarval is zero (i.e. 1.0Exxx)
+ */
+int tarval_ieee754_zero_mantissa(tarval *tv);
+
+/**
+ * Returns the exponent of a floating point IEEE-754
+ * tarval.
+ */
+int tarval_ieee754_get_exponent(tarval *tv);
+
+/**
+ * Set the immediate precision for IEEE-754 results. Set this to
+ * 0 to get the same precision as the operands.
+ * For x87 compatibility, set this to 80.
  *
- * @return
- *   - 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
+ * @return the old setting
  */
-tarval_classification_t classify_tarval(tarval *tv);
+unsigned tarval_ieee754_set_immediate_precision(unsigned bits);
 
 /**
- * Returns non-zero if a given (integer) tarval has only one single bit
- * set.
+ *  Returns non-zero if the result of the last IEEE-754 operation was exact.
  */
-int is_single_bit_tarval(tarval *tv);
+unsigned tarval_ieee754_get_exact(void);
 
 /**
- * Output of tarvals to a buffer.
+ * Enable/Disable floating point constant folding.
  */
-int tarval_snprintf(char *buf, size_t buflen, tarval *tv);
+int tarval_enable_fp_ops(int enable);
 
 /**
- * Output of tarvals to stdio.
+ * Check if its the a floating point NaN.
  */
-int tarval_printf(tarval *tv);
+int tarval_is_NaN(tarval *tv);
+
+/**
+ * Check if its the a floating point +inf.
+ */
+int tarval_is_plus_inf(tarval *tv);
+
+/**
+ * Check if its the a floating point -inf.
+ */
+int tarval_is_minus_inf(tarval *tv);
+
+/**
+ * Check if the tarval represents a finite value, ie neither NaN nor inf.
+ */
+int tarval_is_finite(tarval *tv);
 
 #endif  /* FIRM_TV_TV_H */