51 #ifndef __SYSTEMC_EXT_DT_FX_SCFX_MANT_HH__ 52 #define __SYSTEMC_EXT_DT_FX_SCFX_MANT_HH__ 54 #include "../../utils/endian.hh" 55 #include "../../utils/functions.hh" 66 typedef unsigned int word;
103 static word *
alloc(std::size_t);
104 static void free(word *, std::size_t);
118 #if defined(SC_BOOST_BIG_ENDIAN ) 120 #elif defined(SC_BOOST_LITTLE_ENDIAN) 128 #if defined(SC_BOOST_BIG_ENDIAN) 130 #elif defined(SC_BOOST_LITTLE_ENDIAN) 139 #if defined(SC_BOOST_BIG_ENDIAN) 141 #elif defined(SC_BOOST_LITTLE_ENDIAN) 150 #if defined(SC_BOOST_BIG_ENDIAN) 152 #elif defined(SC_BOOST_LITTLE_ENDIAN) 217 for (
int i = 0;
i <
size;
i++) {
219 #if defined(SC_BOOST_BIG_ENDIAN) 221 #elif defined(SC_BOOST_LITTLE_ENDIAN) 225 #if defined(SC_BOOST_BIG_ENDIAN) 227 #elif defined(SC_BOOST_LITTLE_ENDIAN) 233 for (
int i = 0;
i <
size;
i++) {
235 #if defined(SC_BOOST_BIG_ENDIAN) 237 #elif defined(SC_BOOST_LITTLE_ENDIAN) 241 #if defined(SC_BOOST_BIG_ENDIAN) 242 p[-size + 1 +
i] = 0;
243 #elif defined(SC_BOOST_LITTLE_ENDIAN) 261 "mantissa index out of range");
262 #if defined(SC_BOOST_BIG_ENDIAN) 263 return reinterpret_cast<half_word *
>(
m_array)[-i];
264 #elif defined(SC_BOOST_LITTLE_ENDIAN ) 265 return reinterpret_cast<half_word *
>(
m_array)[i];
273 "mantissa index out of range" );
274 #if defined(SC_BOOST_BIG_ENDIAN) 275 return reinterpret_cast<half_word *
>(
m_array)[-i];
276 #elif defined(SC_BOOST_LITTLE_ENDIAN) 277 return reinterpret_cast<half_word *
>(
m_array)[i];
285 #if defined(SC_BOOST_BIG_ENDIAN) 286 return reinterpret_cast<half_word *
>(
m_array -
i) + 1;
287 #elif defined(SC_BOOST_LITTLE_ENDIAN) 288 return reinterpret_cast<half_word *
>(
m_array +
i);
299 for (
int i = 0;
i <
size;
i++) {
300 target[
i] = ~source[
i];
311 for (
int i = 0;
i < mant.
size();
i++) {
349 void *
operator new(std::size_t sz) { return ::operator
new (sz); }
415 #endif // __SYSTEMC_EXT_DT_FX_SCFX_MANT_HH__
static word * alloc(std::size_t)
half_word half_at(int) const
static void free(word *, std::size_t)
const T sc_min(const T &a, const T &b)
void resize_to(int, int=0)
static void free_word(word *array, std::size_t size)
void inc(scfx_mant &mant)
void complement(scfx_mant &target, const scfx_mant &source, int size)
#define SC_ASSERT_(cnd, msg)
static word * alloc_word(std::size_t size)
scfx_mant & operator=(const scfx_mant &)
scfx_mant_ref & operator=(const scfx_mant &)
word operator[](int) const
half_word * half_addr(int=0) const