gem5  v22.1.0.0
Namespaces | Functions | Variables
intmath.hh File Reference
#include <cassert>
#include <cstdint>
#include <type_traits>
#include <utility>
#include "base/bitfield.hh"

Go to the source code of this file.

Namespaces

 gem5
 Reference material can be found at the JEDEC website: UFS standard http://www.jedec.org/standards-documents/results/jesd220 UFS HCI specification http://www.jedec.org/standards-documents/results/jesd223.
 

Functions

template<class T >
static constexpr std::enable_if_t< std::is_integral_v< T >, int > gem5::floorLog2 (T x)
 
template<class T >
static constexpr int gem5::ceilLog2 (const T &n)
 
template<class T >
static constexpr bool gem5::isPowerOf2 (const T &n)
 
template<class T , class U >
static constexpr T gem5::divCeil (const T &a, const U &b)
 
template<typename T >
static constexpr std::enable_if_t< sizeof(T)==sizeof(uint64_t)> gem5::mulUnsigned (std::make_unsigned_t< T > &high, std::make_unsigned_t< T > &low, std::make_unsigned_t< T > val_a, std::make_unsigned_t< T > val_b)
 
template<typename T >
static constexpr std::enable_if_t< sizeof(T)==sizeof(uint64_t)> gem5::mulSignedManual (std::make_signed_t< T > &high, std::make_signed_t< T > &low, std::make_signed_t< T > val_a, std::make_signed_t< T > val_b)
 
template<typename T >
static constexpr std::enable_if_t< sizeof(T)==sizeof(uint64_t)> gem5::mulSigned (std::make_signed_t< T > &high, std::make_signed_t< T > &low, std::make_signed_t< T > val_a, std::make_signed_t< T > val_b)
 
template<typename T >
static constexpr std::pair< std::make_unsigned_t< T >, std::make_unsigned_t< T > > gem5::mulUnsigned (std::make_unsigned_t< T > val_a, std::make_unsigned_t< T > val_b)
 
template<typename T >
static constexpr std::pair< std::make_signed_t< T >, std::make_signed_t< T > > gem5::mulSigned (std::make_signed_t< T > val_a, std::make_signed_t< T > val_b)
 
template<class T , class U >
static constexpr T gem5::roundUp (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
template<class T , class U >
static constexpr T gem5::roundDown (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
static constexpr int gem5::log2i (int value)
 Calculate the log2 of a power of 2 integer. More...
 

Variables

 gem5::c2 = 31
 
 gem5::high = AB + c2
 

Generated on Wed Dec 21 2022 10:22:53 for gem5 by doxygen 1.9.1