libFirm 1.20
|
Representation of and static computations on target machine values. More...
Go to the source code of this file.
Data Structures | |
struct | tarval_mode_info |
This structure contains helper information to format the output of a tarval of a mode. More... | |
Defines | |
#define | tarval_top tarval_undefined |
The 'top' tarval. | |
#define | get_tarval_top() get_tarval_undefined() |
Returns the 'top' tarval. | |
#define | tarval_bottom tarval_bad |
The 'bottom' tarval. | |
#define | get_tarval_bottom() get_tarval_bad() |
Returns the 'bottom' tarval. | |
Enumerations | |
enum | tarval_int_overflow_mode_t { TV_OVERFLOW_BAD, TV_OVERFLOW_WRAP, TV_OVERFLOW_SATURATE } |
Modes for handling integer overflows. More... | |
enum | tv_output_mode { TVO_NATIVE, TVO_HEX, TVO_DECIMAL, TVO_OCTAL, TVO_BINARY, TVO_FLOAT, TVO_HEXFLOAT } |
The output mode for tarval values. More... | |
Functions | |
ir_tarval * | new_tarval_from_str (const char *str, size_t len, ir_mode *mode) |
Constructor function for new tarvals. | |
ir_tarval * | new_integer_tarval_from_str (const char *str, size_t len, char sign, unsigned char base, ir_mode *mode) |
Construct a new tarval from a given string. | |
ir_tarval * | new_tarval_from_long (long l, ir_mode *mode) |
Constructor function for new tarvals. | |
long | get_tarval_long (ir_tarval *tv) |
Returns value as long if possible. | |
int | tarval_is_long (ir_tarval *tv) |
This validates if get_tarval_long() will return a satisfying result. | |
ir_tarval * | new_tarval_from_double (double d, ir_mode *mode) |
Constructor function for new tarvals. | |
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 | |
double | get_tarval_double (ir_tarval *tv) |
This returns a double with the value represented value, or gibberish, depending on the size of double and the size of the stored value. | |
long double | get_tarval_long_double (ir_tarval *tv) |
same as get_tarval_double but returns a long double value | |
int | tarval_is_double (ir_tarval *tv) |
This validates if tarval_to_double() will return a satisfying result. | |
ir_mode * | get_tarval_mode (const ir_tarval *tv) |
Returns the mode of the tarval. | |
int | tarval_is_negative (ir_tarval *tv) |
Returns 1 if tv is negative. | |
int | tarval_is_null (ir_tarval *tv) |
Returns 1 if tv is null. | |
int | tarval_is_one (ir_tarval *tv) |
Returns 1 if tv is the "one". | |
int | tarval_is_minus_one (ir_tarval *tv) |
Returns 1 if tv is the "minus one". | |
int | tarval_is_all_one (ir_tarval *tv) |
returns non-zero if all bits in the tarval are set | |
int | tarval_is_constant (ir_tarval *tv) |
Returns non-zero if the tarval is a constant (ie. | |
ir_tarval * | get_tarval_bad (void) |
Returns the 'bad' tarval. | |
ir_tarval * | get_tarval_undefined (void) |
Returns the 'undefined' tarval. | |
ir_tarval * | get_tarval_b_false (void) |
Returns the mode_b tarval 'false'. | |
ir_tarval * | get_tarval_b_true (void) |
Returns the mode_b tarval 'true'. | |
ir_tarval * | get_tarval_unreachable (void) |
Returns the mode_X tarval 'unreachable'. | |
ir_tarval * | get_tarval_reachable (void) |
Returns the mode_X tarval 'reachable'. | |
ir_tarval * | get_tarval_max (ir_mode *mode) |
Returns the maximum value of a given mode. | |
ir_tarval * | get_tarval_min (ir_mode *mode) |
Returns the minimum value of a given mode. | |
ir_tarval * | get_tarval_null (ir_mode *mode) |
Returns the 0 value (additive neutral) of a given mode. | |
ir_tarval * | get_tarval_one (ir_mode *mode) |
Returns the 1 value (multiplicative neutral) of a given mode. | |
ir_tarval * | get_tarval_minus_one (ir_mode *mode) |
Returns the -1 value (multiplicative neutral) of a given mode. | |
ir_tarval * | get_tarval_all_one (ir_mode *mode) |
returns the value where all bits are 1 of a given mode. | |
ir_tarval * | get_tarval_nan (ir_mode *mode) |
Returns quite nan for float_number modes. | |
ir_tarval * | get_tarval_plus_inf (ir_mode *mode) |
Returns +inf for float_number modes. | |
ir_tarval * | get_tarval_minus_inf (ir_mode *mode) |
Returns -inf for float_number modes. | |
void | tarval_set_integer_overflow_mode (tarval_int_overflow_mode_t ov_mode) |
Sets the overflow mode for integer operations. | |
tarval_int_overflow_mode_t | tarval_get_integer_overflow_mode (void) |
Returns the overflow mode for integer operations. | |
ir_relation | tarval_cmp (ir_tarval *a, ir_tarval *b) |
Compares two tarvals. | |
ir_tarval * | tarval_convert_to (ir_tarval *src, ir_mode *mode) |
Converts a tarval to another mode. | |
ir_tarval * | tarval_not (ir_tarval *a) |
Bitwise Negation of a tarval. | |
ir_tarval * | tarval_neg (ir_tarval *a) |
Arithmetic Negation of a tarval. | |
ir_tarval * | tarval_add (ir_tarval *a, ir_tarval *b) |
Addition of two tarvals. | |
ir_tarval * | tarval_sub (ir_tarval *a, ir_tarval *b, ir_mode *dst_mode) |
Subtraction from a tarval. | |
ir_tarval * | tarval_mul (ir_tarval *a, ir_tarval *b) |
Multiplication of tarvals. | |
ir_tarval * | tarval_div (ir_tarval *a, ir_tarval *b) |
Integer division of two tarvals. | |
ir_tarval * | tarval_mod (ir_tarval *a, ir_tarval *b) |
Remainder of integer division. | |
ir_tarval * | tarval_divmod (ir_tarval *a, ir_tarval *b, ir_tarval **mod_res) |
Integer division AND remainder. | |
ir_tarval * | tarval_abs (ir_tarval *a) |
Absolute value of a tarval. | |
ir_tarval * | tarval_and (ir_tarval *a, ir_tarval *b) |
Bitwise and of two integer tarvals. | |
ir_tarval * | tarval_andnot (ir_tarval *a, ir_tarval *b) |
Bitwise and not of two integer tarvals. | |
ir_tarval * | tarval_or (ir_tarval *a, ir_tarval *b) |
Bitwise or of two integer tarvals. | |
ir_tarval * | tarval_eor (ir_tarval *a, ir_tarval *b) |
Bitwise exclusive or of two integer tarvals. | |
ir_tarval * | tarval_shl (ir_tarval *a, ir_tarval *b) |
Logical Left shift. | |
ir_tarval * | tarval_shr (ir_tarval *a, ir_tarval *b) |
Unsigned (logical) right shift. | |
ir_tarval * | tarval_shrs (ir_tarval *a, ir_tarval *b) |
Signed (arithmetic) right shift. | |
ir_tarval * | tarval_rotl (ir_tarval *a, ir_tarval *b) |
Rotation to left. | |
int | tarval_carry (void) |
Returns the carry flag of the last operation. | |
int | set_tarval_mode_output_option (ir_mode *mode, const tarval_mode_info *modeinfo) |
Specify the output options of one mode. | |
const tarval_mode_info * | get_tarval_mode_output_option (ir_mode *mode) |
Returns the output options of one mode. | |
char * | get_tarval_bitpattern (ir_tarval *tv) |
Returns Bit representation of a tarval value, as string of '0' and '1'. | |
unsigned char | get_tarval_sub_bits (ir_tarval *tv, unsigned byte_ofs) |
Returns the bitpattern of the bytes_ofs byte. | |
int | tarval_is_single_bit (ir_tarval *tv) |
Returns non-zero if a given (integer) tarval has only one single bit set. | |
int | get_tarval_popcount (ir_tarval *tv) |
Returns the number of set bits in a given (integer) tarval. | |
int | get_tarval_lowest_bit (ir_tarval *tv) |
Returns the number of the lowest set bit in a given (integer) tarval. | |
int | tarval_snprintf (char *buf, size_t buflen, ir_tarval *tv) |
Output a tarval to a string buffer. | |
int | tarval_printf (ir_tarval *tv) |
Output a tarval to stdio. | |
int | tarval_zero_mantissa (ir_tarval *tv) |
Returns non-zero if the mantissa of a floating point tarval is zero (i.e. | |
int | tarval_get_exponent (ir_tarval *tv) |
Returns the exponent of a floating point IEEE-754 tarval. | |
int | tarval_ieee754_can_conv_lossless (ir_tarval *tv, ir_mode *mode) |
Check if the tarval can be converted to the given mode without precision loss. | |
unsigned | tarval_ieee754_get_exact (void) |
Returns non-zero if the result of the last IEEE-754 operation was exact. | |
void | tarval_enable_fp_ops (int enable) |
Enable/Disable floating point constant folding. | |
int | tarval_fp_ops_enabled (void) |
returns 0/1 if floating point folding is enable/disabled | |
int | tarval_is_NaN (ir_tarval *tv) |
Check if its the a floating point NaN. | |
int | tarval_is_plus_inf (ir_tarval *tv) |
Check if its the a floating point +inf. | |
int | tarval_is_minus_inf (ir_tarval *tv) |
Check if its the a floating point -inf. | |
int | tarval_is_finite (ir_tarval *tv) |
Check if the tarval represents a finite value, ie neither NaN nor inf. | |
int | is_tarval (const void *thing) |
Checks whether a pointer points to a tarval. | |
Variables | |
ir_tarval * | tarval_bad |
The 'bad' tarval. | |
ir_tarval * | tarval_undefined |
The 'undefined' tarval. | |
ir_tarval * | tarval_b_false |
The mode_b tarval 'false'. | |
ir_tarval * | tarval_b_true |
The mode_b tarval 'true'. | |
ir_tarval * | tarval_unreachable |
The mode_X tarval 'unreachable'. | |
ir_tarval * | tarval_reachable |
The mode_X tarval 'reachable'. |
Representation of and static computations on target machine values.
Definition in file tv.h.