38 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 72 inline std::array<uint32_t, N>
const&
GetBits()
const;
73 inline std::array<uint32_t, N>&
GetBits();
75 inline uint32_t
GetBack()
const;
81 bool Write(std::ofstream& output)
const;
90 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 91 static std::atomic<int32_t> msMaxSize;
93 static void SetMaxSizeToZero() { msMaxSize = 0; }
94 static int32_t GetMaxSize() {
return msMaxSize; }
105 static_assert(N >= 1,
"Invalid size N.");
111 static_assert(N >= 1,
"Invalid size N.");
119 static_assert(N >= 1,
"Invalid size N.");
127 mBits[0] = (number >> last);
135 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 143 static_assert(N >= 2,
"N not large enough to store 64-bit integers.");
164 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 173 mSize(1 + (numBits - 1) / 32)
175 static_assert(N >= 1,
"Invalid size N.");
177 #if defined(GTE_ASSERT_ON_UINTEGERFP32_OUT_OF_RANGE) 178 LogAssert(
mSize <= N,
"N not large enough to store number of bits.");
181 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 189 static_assert(N >= 1,
"Invalid size N.");
201 *
this = std::move(number);
208 mSize = number.mSize;
209 std::copy(number.mBits.begin(), number.mBits.begin() +
mSize,
220 mSize = 1 + (numBits - 1) / 32;
222 #if defined(GTE_ASSERT_ON_UINTEGERFP32_OUT_OF_RANGE) 223 LogAssert(
mSize <= N,
"N not large enough to store number of bits.");
226 #if defined(GTE_COLLECT_UINTEGERFP32_STATISTICS) 231 template <
int N>
inline 237 template <
int N>
inline 243 template <
int N>
inline 249 template <
int N>
inline 255 template <
int N>
inline 261 template <
int N>
inline 275 if (output.write((
char const*)&
mSize,
sizeof(
mSize)).bad())
280 return output.write((
char const*)&
mBits[0],
292 if (input.read((
char*)&
mSize,
sizeof(
mSize)).bad())
int32_t GetNumBits() const
bool Read(std::ifstream &input)
GTE_IMPEXP int32_t GetTrailingBit(uint32_t value)
#define LogAssert(condition, message)
UIntegerFP32 & operator=(UIntegerFP32 const &number)
GTE_IMPEXP int32_t GetLeadingBit(uint32_t value)
std::array< uint32_t, N > mBits
bool Write(std::ofstream &output) const
GLsizei const GLfloat * value
std::array< uint32_t, N > const & GetBits() const
friend class UnitTestBSNumber
#define GTE_GET_HI_U64(v)
#define GTE_GET_LO_U64(v)
GLenum GLenum GLenum input
void SetBack(uint32_t value)
void SetNumBits(uint32_t numBits)
T AtomicMax(std::atomic< T > &v0, T const &v1)