X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftv%2Ffltcalc.h;h=b6d5a5a1720f0ffbd5bbf8e43a4fe5a05b65126d;hb=1c7d12b4d500e778b30bc251a22189a3f11a9d69;hp=6c4594519440095f3b9622300351f41f8289f879;hpb=a756679c7134fec65f78d8206cab1ec08c7c8635;p=libfirm diff --git a/ir/tv/fltcalc.h b/ir/tv/fltcalc.h index 6c4594519..b6d5a5a17 100644 --- a/ir/tv/fltcalc.h +++ b/ir/tv/fltcalc.h @@ -1,7 +1,19 @@ +/* + * Project: libFIRM + * File name: ir/tv/fltcalc.h + * Purpose: + * Author: + * Modified by: + * Created: 2003 + * CVS-ID: $Id$ + * Copyright: (c) 2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ + #ifndef _FLTCALC_H_ #define _FLTCALC_H_ -#include +#include "firm_config.h" #ifdef HAVE_LONG_DOUBLE /* XXX Set this via autoconf */ @@ -18,14 +30,14 @@ typedef enum { FC_div, /**< divide */ FC_neg, /**< negate */ FC_int, /**< truncate to integer */ - FC_rnd, /**< round to integer */ + FC_rnd /**< round to integer */ } fc_op_t; enum { FC_DEC, FC_HEX, FC_BIN, - FC_PACKED, + FC_PACKED }; /* rounding modes */ @@ -33,7 +45,7 @@ typedef enum { FC_TONEAREST, FC_TOPOSITIVE, FC_TONEGATIVE, - FC_TOZERO, + FC_TOZERO } fc_rounding_mode_t; #define FC_DEFAULT_PRECISION 64 @@ -57,7 +69,7 @@ char* fc_val_from_str(const char *str, unsigned int len, char exp_size, char man /** get the representation of a floating point value * This function tries to builds a representation having the same value as the * float number passed. - * If the wished precision is less than the precicion of LLDBL the value built + * If the wished precision is less than the precision of LLDBL the value built * will be rounded. Therefore only an approximation of the passed float can be * expected in this case. * @@ -124,7 +136,7 @@ char* fc_get_snan(unsigned int exponent_size, unsigned int mantissa_size, char* char* fc_get_qnan(unsigned int exponent_size, unsigned int mantissa_size, char* result); char* fc_get_plusinf(unsigned int exponent_size, unsigned int mantissa_size, char* result); char* fc_get_minusinf(unsigned int exponent_size, unsigned int mantissa_size, char* result); -/*}@*/ +/*@}*/ int fc_is_zero(const void *a); int fc_is_negative(const void *a); @@ -179,7 +191,7 @@ int fc_comp(const void *a, const void *b); * Values too big to represent will round to the biggest/smallest * representable value. * - * These modes correspond to the modes required by the ieee standard. + * These modes correspond to the modes required by the IEEE standard. * * @param mode The new rounding mode. Any value other than the four * defined values will have no effect. @@ -200,20 +212,20 @@ fc_rounding_mode_t fc_get_rounding_mode(void); /** Get bit representation of a value * This function allows to read a value in encoded form, bytewise. - * The value will be packed corresponding to the way used by the ieee + * The value will be packed corresponding to the way used by the IEEE * encoding formats, i.e. * One bit sign * exp_size bits exponent + bias * mant_size bits mantissa, without leading 1 * - * As in ieee, an exponent of 0 indicates a denormalized number, which + * As in IEEE, an exponent of 0 indicates a denormalized number, which * implies a most significant bit of zero instead of one; an exponent * of all ones (2**exp_size - 1) encodes infinity if the mantissa is - * all zeroes, else Not A Number. + * all zeros, else Not A Number. * * @param val A pointer to the value. If NULL is passed a copy of the * most recent value passed to this function is used, saving the - * packing step. This behaviour may be changed in the future. + * packing step. This behavior may be changed in the future. * @param num_bit The maximum number of bits to return. Any bit beyond * num_bit will be returned as zero. * @param byte_ofs The byte index to read, 0 is the least significant @@ -223,4 +235,6 @@ fc_rounding_mode_t fc_get_rounding_mode(void); unsigned char fc_sub_bits(const void *val, unsigned num_bit, unsigned byte_ofs); void init_fltcalc(int precision); +void finish_fltcalc (void); + #endif /* _FLTCALC_H_ */