gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
intmath.hh File Reference
#include <cassert>
#include "base/logging.hh"
#include "base/types.hh"

Go to the source code of this file.

Functions

uint64_t power (uint32_t n, uint32_t e)
 
int floorLog2 (unsigned x)
 
int floorLog2 (unsigned long x)
 
int floorLog2 (unsigned long long x)
 
int floorLog2 (int x)
 
int floorLog2 (long x)
 
int floorLog2 (long long x)
 
template<class T >
int ceilLog2 (const T &n)
 
template<class T >
bool isPowerOf2 (const T &n)
 
template<class T , class U >
divCeil (const T &a, const U &b)
 
template<class T , class U >
roundUp (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
template<class T , class U >
roundDown (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 

Function Documentation

◆ ceilLog2()

template<class T >
int ceilLog2 ( const T &  n)
inline

◆ divCeil()

template<class T , class U >
T divCeil ( const T &  a,
const U &  b 
)
inline

◆ floorLog2() [1/6]

int floorLog2 ( unsigned  x)
inline

◆ floorLog2() [2/6]

int floorLog2 ( unsigned long  x)
inline

Definition at line 77 of file intmath.hh.

References ULL.

◆ floorLog2() [3/6]

int floorLog2 ( unsigned long long  x)
inline

Definition at line 96 of file intmath.hh.

References ULL.

◆ floorLog2() [4/6]

int floorLog2 ( int  x)
inline

Definition at line 113 of file intmath.hh.

References floorLog2().

◆ floorLog2() [5/6]

int floorLog2 ( long  x)
inline

Definition at line 120 of file intmath.hh.

References floorLog2().

◆ floorLog2() [6/6]

int floorLog2 ( long long  x)
inline

Definition at line 127 of file intmath.hh.

References floorLog2().

◆ isPowerOf2()

template<class T >
bool isPowerOf2 ( const T &  n)
inline

◆ power()

uint64_t power ( uint32_t  n,
uint32_t  e 
)
inline

◆ roundDown()

template<class T , class U >
T roundDown ( const T &  val,
const U &  align 
)
inline

◆ roundUp()

template<class T , class U >
T roundUp ( const T &  val,
const U &  align 
)
inline

Generated on Fri Feb 28 2020 16:27:06 for gem5 by doxygen 1.8.13