23#define SREAL_PART_BITS 31
27#define SREAL_MIN_SIG ((int64_t) 1 << (SREAL_PART_BITS - 2))
28#define SREAL_MAX_SIG (((int64_t) 1 << (SREAL_PART_BITS - 1)) - 1)
29#define SREAL_MAX_EXP (INT_MAX / 4)
31#define SREAL_BITS SREAL_PART_BITS
33#define SREAL_SIGN(v) (v < 0 ? -1: 1)
34#define SREAL_ABS(v) (v < 0 ? -v: v)
52 void dump (FILE *)
const;
69 bool negative =
m_sig < 0;
70 bool other_negative = other.
m_sig < 0;
72 if (negative != other_negative)
73 return negative > other_negative;
76 return negative ? !
r :
r;
133 inline void normalize (int64_t new_sig,
signed int new_exp);
134 inline void normalize_up (int64_t new_sig,
signed int new_exp);
174 return !(
a ==
b ||
a <
b);
179 return a <
b ||
a ==
b;
184 return a ==
b ||
a >
b;
204 unsigned HOST_WIDE_INT sig =
absu_hwi (new_sig);
233 unsigned HOST_WIDE_INT sig =
absu_hwi (new_sig);
237 last_bit = (sig >> (
shift-1)) & 1;
268 unsigned HOST_WIDE_INT sig =
absu_hwi (new_sig);
static sreal stream_in(class lto_input_block *)
Definition sreal.cc:280
void dump(FILE *) const
Definition sreal.cc:65
void normalize_up(int64_t new_sig, signed int new_exp)
Definition sreal.h:202
sreal operator+(const sreal &other) const
Definition sreal.cc:157
static sreal max()
Definition sreal.h:123
void stream_out(struct output_block *)
Definition sreal.cc:271
int32_t m_sig
Definition sreal.h:140
sreal()
Definition sreal.h:44
int64_t to_int() const
Definition sreal.cc:108
void shift_right(int amount)
Definition sreal.cc:90
static sreal signedless_plus(const sreal &a, const sreal &b, bool negative)
int64_t to_nearest_int() const
Definition sreal.cc:126
bool operator==(const sreal &other) const
Definition sreal.h:80
void normalize_down(int64_t new_sig, signed int new_exp)
Definition sreal.h:230
sreal(int64_t sig, int exp=0)
Definition sreal.h:47
sreal operator*(const sreal &other) const
Definition sreal.cc:241
double to_double() const
Definition sreal.cc:146
sreal shift(int s) const
Definition sreal.h:93
static sreal signedless_minus(const sreal &a, const sreal &b, bool negative)
static sreal min()
Definition sreal.h:113
sreal operator/(const sreal &other) const
Definition sreal.cc:259
signed int m_exp
Definition sreal.h:141
void normalize(int64_t new_sig, signed int new_exp)
Definition sreal.h:266
bool operator<(const sreal &other) const
Definition sreal.h:63
sreal operator-() const
Definition sreal.h:85
bool debug
Definition collect-utils.cc:34
unsigned int shift
Definition ggc-page.cc:233
int floor_log2(unsigned HOST_WIDE_INT x)
Definition hwint.cc:36
unsigned HOST_WIDE_INT absu_hwi(HOST_WIDE_INT)
Definition hwint.h:352
poly_int< N, C > r
Definition poly-int.h:774
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
bool operator!=(const sreal &a, const sreal &b)
Definition sreal.h:167
#define SREAL_SIGN(v)
Definition sreal.h:33
sreal operator>>(const sreal &a, int exp)
Definition sreal.h:192
sreal & operator/=(sreal &a, const sreal &b)
Definition sreal.h:157
#define SREAL_MAX_SIG
Definition sreal.h:28
bool operator<=(const sreal &a, const sreal &b)
Definition sreal.h:177
sreal & operator*=(sreal &a, const sreal &b)
Definition sreal.h:162
sreal operator<<(const sreal &a, int exp)
Definition sreal.h:187
bool operator>(const sreal &a, const sreal &b)
Definition sreal.h:172
#define SREAL_PART_BITS
Definition sreal.h:23
#define SREAL_MAX_EXP
Definition sreal.h:29
sreal & operator-=(sreal &a, const sreal &b)
Definition sreal.h:152
#define SREAL_MIN_SIG
Definition sreal.h:27
sreal & operator+=(sreal &a, const sreal &b)
Definition sreal.h:147
bool operator>=(const sreal &a, const sreal &b)
Definition sreal.h:182
Definition lto-streamer.h:698
#define gcc_checking_assert(EXPR)
Definition system.h:828