The Sparta Modeling Framework
Loading...
Searching...
No Matches
Bits.hpp File Reference

Helper functions to count bits. A little old – consider using compiler intrinsics. More...

#include <cinttypes>
#include <cassert>
#include <typeinfo>
#include "sparta/utils/SpartaException.hpp"

Go to the source code of this file.

Namespaces

namespace  sparta
 Macros for handling exponential backoff.
 

Functions

template<class T >
uint32_t sparta::utils::count_1_bits (const T &)
 
template<>
uint32_t sparta::utils::count_1_bits< uint32_t > (const uint32_t &n)
 
template<>
uint32_t sparta::utils::count_1_bits< uint64_t > (const uint64_t &n)
 

Detailed Description

Helper functions to count bits. A little old – consider using compiler intrinsics.

Definition in file Bits.hpp.

Function Documentation

◆ count_1_bits()

template<class T >
uint32_t sparta::utils::count_1_bits ( const T &  )
inline

Definition at line 19 of file Bits.hpp.

◆ count_1_bits< uint32_t >()

template<>
uint32_t sparta::utils::count_1_bits< uint32_t > ( const uint32_t &  n)
inline

Definition at line 27 of file Bits.hpp.

◆ count_1_bits< uint64_t >()

template<>
uint32_t sparta::utils::count_1_bits< uint64_t > ( const uint64_t &  n)
inline

Definition at line 38 of file Bits.hpp.