18 #include "firm_types.h"
int tarval_get_wrap_on_overflow(void)
Returns 0 if operations return bad on overflow, != 0 if they wrap around.
int tarval_is_quiet_nan(const ir_tarval *tv)
Check if tv is a floating point quiet NaN.
ir_tarval * get_tarval_unknown(void)
Returns the 'unknown' tarval.
ir_tarval * tarval_sub(ir_tarval *a, ir_tarval *b)
Subtraction from a tarval.
int tarval_get_exponent(const ir_tarval *tv)
Returns the exponent of a floating point IEEE-754 tarval.
int get_tarval_lowest_bit(const ir_tarval *tv)
Returns the number of the lowest set bit in a given (integer) tarval.
ir_tarval * tarval_b_false
The mode_b tarval 'false'.
ir_tarval * tarval_andnot(ir_tarval *a, ir_tarval *b)
Bitwise and not of two integer tarvals.
ir_tarval * tarval_shl(ir_tarval *a, ir_tarval *b)
Logical Left shift.
ir_mode * get_tarval_mode(const ir_tarval *tv)
Returns the mode of the tarval.
ir_tarval * tarval_div(ir_tarval *a, ir_tarval *b)
Integer division of two tarvals.
ir_tarval * tarval_mul(ir_tarval *a, ir_tarval *b)
Multiplication of tarvals.
int tarval_is_signaling_nan(const ir_tarval *tv)
Check if tv is a floating point signaling NaN.
ir_tarval * tarval_not(ir_tarval *a)
Bitwise Negation of a tarval.
int tarval_is_null(const ir_tarval *tv)
Returns 1 if tv is null.
unsigned tarval_ieee754_get_exact(void)
Returns non-zero if the result of the last IEEE-754 operation was exact.
ir_tarval * tarval_shl_unsigned(ir_tarval *a, unsigned b)
logical left shift (variant with unsigned argument).
long get_tarval_long(const ir_tarval *tv)
Returns value as long if possible.
ir_tarval * tarval_eor(ir_tarval *a, ir_tarval *b)
Bitwise exclusive or of two integer tarvals.
ir_tarval * tarval_mod(ir_tarval *a, ir_tarval *b)
Remainder of integer division.
ir_tarval * new_tarval_from_long(long l, ir_mode *mode)
Constructor function for new tarvals.
int tarval_is_negative(const ir_tarval *tv)
Returns 1 if tv is negative.
unsigned char get_tarval_sub_bits(const ir_tarval *tv, unsigned byte_ofs)
Returns the bitpattern of the bytes_ofs byte.
int tarval_zero_mantissa(const ir_tarval *tv)
Returns non-zero if the mantissa of a floating point tarval is zero (i.e.
ir_tarval * tarval_add(ir_tarval *a, ir_tarval *b)
Addition of two tarvals.
ir_tarval * tarval_convert_to(ir_tarval *src, ir_mode *mode)
Converts a tarval to another mode.
int tarval_is_double(const ir_tarval *tv)
This validates if tarval_to_double() will return a satisfying result.
long double get_tarval_long_double(const ir_tarval *tv)
same as get_tarval_double but returns a long double value
void tarval_set_wrap_on_overflow(int wrap_on_overflow)
Sets whether values should wrap on overflow or return the bad value.
ir_tarval * get_tarval_bad(void)
Returns the 'bad' tarval.
ir_tarval * get_tarval_b_false(void)
Returns the mode_b tarval 'false'.
ir_tarval * new_tarval_from_bytes(unsigned char const *buf, ir_mode *mode)
Construct a new tarval from a sequence of bytes.
ir_tarval *const tarval_unknown
The 'unknown' tarval.
ir_tarval * new_tarval_from_long_double(long double d, ir_mode *mode)
same as new_tarval_from_double(), but with a long double argument
ir_tarval * tarval_divmod(ir_tarval *a, ir_tarval *b, ir_tarval **mod_res)
Integer division AND remainder.
ir_tarval * get_tarval_b_true(void)
Returns the mode_b tarval 'true'.
ir_tarval * tarval_shr_unsigned(ir_tarval *a, unsigned b)
unsigned (logical) right shift (variant with unsigned argument).
int tarval_is_finite(const ir_tarval *tv)
Check if the tarval represents a finite value, ie neither NaN nor inf.
int tarval_ieee754_can_conv_lossless(const ir_tarval *tv, const ir_mode *mode)
Check if the tarval can be converted to the given mode without precision loss.
int get_tarval_highest_bit(const ir_tarval *tv)
Return the number of the highest set bit in a given (integer) tarval.
ir_tarval * tarval_and(ir_tarval *a, ir_tarval *b)
Bitwise and of two integer tarvals.
int get_tarval_popcount(const ir_tarval *tv)
Returns the number of set bits in a given (integer) tarval.
ir_tarval * tarval_neg(ir_tarval *a)
Arithmetic Negation of a tarval.
struct ir_tarval ir_tarval
Target Machine Value.
ir_tarval * tarval_abs(ir_tarval *a)
Absolute value of a tarval.
ir_tarval * new_tarval_nan(ir_mode *mode, int signaling, ir_tarval *payload)
Construct a new floating point quiet NaN value.
int tarval_is_long(const ir_tarval *tv)
This validates if get_tarval_long() will return something sensible.
ir_relation
Relations for comparing numbers.
ir_tarval * tarval_shrs_unsigned(ir_tarval *a, unsigned b)
signed (arithmetic) right shift (variant with unsigned argument).
int tarval_is_all_one(const ir_tarval *tv)
returns non-zero if all bits in the tarval are set.
ir_tarval * tarval_ornot(ir_tarval *a, ir_tarval *b)
Bitwise or not of two integer tarvals.
int tarval_is_constant(const ir_tarval *tv)
Returns non-zero if the tarval is a constant (i.e.
int tarval_is_one(const ir_tarval *tv)
Returns 1 if tv is the "one".
ir_tarval * new_integer_tarval_from_str(const char *str, size_t len, int negative, unsigned char base, ir_mode *mode)
Construct a new tarval from a given string.
struct ir_mode ir_mode
SSA Value mode.
ir_tarval * tarval_b_true
The mode_b tarval 'true'.
ir_tarval * tarval_shr(ir_tarval *a, ir_tarval *b)
Unsigned (logical) right shift.
ir_tarval *const tarval_bad
The 'bad' tarval.
ir_tarval * new_tarval_from_double(double d, ir_mode *mode)
Constructor function for new tarvals.
ir_tarval * new_tarval_from_str(const char *str, size_t len, ir_mode *mode)
Constructor function for new tarvals.
ir_tarval * tarval_bitcast(ir_tarval *src, ir_mode *mode)
Converts a tarval to another mode by reinterpreting the contained bits.
int tarval_is_nan(const ir_tarval *tv)
Check if tv is a floating point NaN.
ir_tarval * tarval_or(ir_tarval *a, ir_tarval *b)
Bitwise or of two integer tarvals.
void tarval_to_bytes(unsigned char *buffer, ir_tarval *tv)
Write tarval to a sequence of bytes.
ir_tarval * tarval_shrs(ir_tarval *a, ir_tarval *b)
Signed (arithmetic) right shift.
double get_tarval_double(const ir_tarval *tv)
This returns a double with the value represented value, or gibberish, depending on the size of double...
ir_relation tarval_cmp(const ir_tarval *a, const ir_tarval *b)
Compares two tarvals.