GCC Middle and Back End API Reference
sreal.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  sreal
 

Macros

#define SREAL_PART_BITS   31
 
#define UINT64_BITS   64
 
#define SREAL_MIN_SIG   ((int64_t) 1 << (SREAL_PART_BITS - 2))
 
#define SREAL_MAX_SIG   (((int64_t) 1 << (SREAL_PART_BITS - 1)) - 1)
 
#define SREAL_MAX_EXP   (INT_MAX / 4)
 
#define SREAL_BITS   SREAL_PART_BITS
 
#define SREAL_SIGN(v)   (v < 0 ? -1: 1)
 
#define SREAL_ABS(v)   (v < 0 ? -v: v)
 

Functions

void debug (const sreal &ref)
 
void debug (const sreal *ptr)
 
srealoperator+= (sreal &a, const sreal &b)
 
srealoperator-= (sreal &a, const sreal &b)
 
srealoperator/= (sreal &a, const sreal &b)
 
srealoperator*= (sreal &a, const sreal &b)
 
bool operator!= (const sreal &a, const sreal &b)
 
bool operator> (const sreal &a, const sreal &b)
 
bool operator<= (const sreal &a, const sreal &b)
 
bool operator>= (const sreal &a, const sreal &b)
 
sreal operator<< (const sreal &a, int exp)
 
sreal operator>> (const sreal &a, int exp)
 

Macro Definition Documentation

◆ SREAL_ABS

#define SREAL_ABS ( v)    (v < 0 ? -v: v)

◆ SREAL_BITS

◆ SREAL_MAX_EXP

◆ SREAL_MAX_SIG

#define SREAL_MAX_SIG   (((int64_t) 1 << (SREAL_PART_BITS - 1)) - 1)

◆ SREAL_MIN_SIG

#define SREAL_MIN_SIG   ((int64_t) 1 << (SREAL_PART_BITS - 2))

◆ SREAL_PART_BITS

#define SREAL_PART_BITS   31
Definitions for simple data type for real numbers.
   Copyright (C) 2002-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   

Referenced by sreal::normalize_down(), sreal::normalize_up(), sreal::operator/(), sreal::to_int(), and sreal::to_nearest_int().

◆ SREAL_SIGN

#define SREAL_SIGN ( v)    (v < 0 ? -1: 1)

◆ UINT64_BITS

#define UINT64_BITS   64

Function Documentation

◆ debug() [1/2]

void debug ( const sreal & ref)
extern

References sreal::dump().

◆ debug() [2/2]

void debug ( const sreal * ptr)
extern

References debug.

◆ operator!=()

bool operator!= ( const sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator*=()

sreal & operator*= ( sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator+=()

sreal & operator+= ( sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator-=()

sreal & operator-= ( sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator/=()

sreal & operator/= ( sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator<<()

sreal operator<< ( const sreal & a,
int exp )
inline

References a, exp(), and sreal::shift().

◆ operator<=()

bool operator<= ( const sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator>()

bool operator> ( const sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator>=()

bool operator>= ( const sreal & a,
const sreal & b )
inline

References a, and b.

◆ operator>>()

sreal operator>> ( const sreal & a,
int exp )
inline

References a, exp(), and sreal::shift().