return tarval_bad;
}
+tarval *get_tarval_minus_one(ir_mode *mode)
+{
+ ANNOUNCE();
+ assert(mode);
+
+ if (get_mode_n_vector_elems(mode) > 1) {
+ /* vector arithmetic not implemented yet */
+ return tarval_bad;
+ }
+
+ switch(get_mode_sort(mode))
+ {
+ case irms_control_flow:
+ case irms_memory:
+ case irms_auxiliary:
+ case irms_internal_boolean:
+ case irms_reference:
+ assert(0);
+ break;
+
+ case irms_float_number:
+ return mode_is_signed(mode) ? new_tarval_from_double(-1.0, mode) : tarval_bad;
+
+ case irms_int_number:
+ case irms_character:
+ return mode_is_signed(mode) ? new_tarval_from_long(-1l, mode) : tarval_bad;
+ }
+ return tarval_bad;
+}
+
tarval *get_tarval_nan(ir_mode *mode)
{
ANNOUNCE();
/*
* Returns the output options of one mode.
*
- * This functions returns the modinfo of a given mode.
+ * This functions returns the mode info of a given mode.
*/
const tarval_mode_info *get_tarval_mode_output_option(ir_mode *mode)
{
/** Returns the 1 value (multiplicative neutral) of a given mode. */
tarval *get_tarval_one(ir_mode *mode);
+/** Returns the -1 value (multiplicative neutral) of a given mode.
+ * Returns tarval bad for unsigned modes */
+tarval *get_tarval_minus_one(ir_mode *mode);
+
/** Return quite nan for float_number modes. */
tarval *get_tarval_nan(ir_mode *mode);
* Compares two tarvals
*
* Compare a with b and return a pn_Cmp describing the relation
- * between a and b. This is either Uo, Lt, Eq, Gt, or False if a or b
- * are symbolic pointers which can not be compared at all.
+ * between a and b. This is either pn_Cmp_Uo, pn_Cmp_ Lt, pn_Cmp_ Eq, pn_Cmp_Gt,
+ * or pn_Cmp_False if a or b are symbolic pointers which can not be compared at all.
*
* @param a A tarval to be compared
* @param b A tarval to be compared