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

Go to the source code of this file.

Functions

int prevPrime (int n)
 
template<class T >
bool isPrime (const T &n)
 
template<class T >
leastSigBit (const T &n)
 
template<class T >
bool isPowerOf2 (const T &n)
 
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 >
floorPow2 (const T &n)
 
template<class T >
ceilPow2 (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)
 
template<class T , class U >
roundDown (const T &val, const U &align)
 
bool isHex (char c)
 
bool isOct (char c)
 
bool isDec (char c)
 
int hex2Int (char c)
 

Function Documentation

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

Definition at line 191 of file intmath.hh.

References ceilLog2().

template<class T , class U >
T divCeil ( const T &  a,
const U &  b 
)
inline
int floorLog2 ( unsigned  x)
inline
int floorLog2 ( unsigned long  x)
inline

Definition at line 116 of file intmath.hh.

References ULL.

int floorLog2 ( unsigned long long  x)
inline

Definition at line 135 of file intmath.hh.

References ULL.

int floorLog2 ( int  x)
inline

Definition at line 152 of file intmath.hh.

References floorLog2().

int floorLog2 ( long  x)
inline

Definition at line 159 of file intmath.hh.

References floorLog2().

int floorLog2 ( long long  x)
inline

Definition at line 166 of file intmath.hh.

References floorLog2().

template<class T >
T floorPow2 ( const T &  n)
inline

Definition at line 184 of file intmath.hh.

References floorLog2().

int hex2Int ( char  c)
inline

Definition at line 240 of file intmath.hh.

bool isDec ( char  c)
inline

Definition at line 234 of file intmath.hh.

bool isHex ( char  c)
inline

Definition at line 220 of file intmath.hh.

bool isOct ( char  c)
inline

Definition at line 228 of file intmath.hh.

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

Definition at line 45 of file intmath.hh.

References ArmISA::i, and ArmISA::n.

Referenced by prevPrime().

template<class T >
T leastSigBit ( const T &  n)
inline

Definition at line 66 of file intmath.hh.

Referenced by isPowerOf2().

uint64_t power ( uint32_t  n,
uint32_t  e 
)
inline
int prevPrime ( int  n)

Definition at line 35 of file intmath.cc.

References isPrime(), and ArmISA::n.

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

Generated on Fri Jun 9 2017 13:03:56 for gem5 by doxygen 1.8.6