97#ifndef __ARCH_GENERIC_VEC_REG_HH__
98#define __ARCH_GENERIC_VEC_REG_HH__
124template <
size_t SIZE>
128 static_assert(
SIZE > 0,
129 "Cannot create Vector Register Container of zero size");
131 "Vector Register size limit exceeded");
133 static constexpr inline size_t size() {
return SIZE; };
189 template <
typename VecElem>
194 "VecElem does not evenly divide the register size");
198 template <
typename VecElem>
203 "VecElem does not evenly divide the register size");
213 for (
auto&
b:
v.container) {
232 s << std::hex << std::setfill(
'0') << std::setw(2) << (uint16_t)
b;
259 "Vector register value overflow at unserialize");
261 for (
int i = 0;
i < Sz;
i++) {
263 if (2 *
i < str.size())
264 b = stoul(str.substr(
i * 2, 2),
nullptr, 16);
293 template <
typename VecElem>
305static_assert(
sizeof(DummyVecRegContainer) ==
sizeof(
RegVal));
306static inline std::ostream &
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
const VecElem * as() const
std::string getString(const uint64_t &size) const
bool operator==(const VecRegContainer< S2 > &that) const
Equality operator.
friend std::ostream & operator<<(std::ostream &os, const VecRegContainer< SIZE > &v)
static constexpr size_t size()
VecRegContainer(const VecRegContainer &)=default
VecElem * as()
View interposers.
VecRegContainer< SIZE > & operator=(const VecRegContainer< SIZE > &that)
Assignment operators.
void zero()
Zero the container.
bool operator!=(const VecRegContainer< S2 > &that) const
Inequality operator.
std::array< uint8_t, SIZE > Container
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
static std::ostream & operator<<(std::ostream &os, const DummyMatRegContainer &d)
constexpr unsigned MaxVecRegLenInBytes
void ccprintf(cp::Print &print)
Dummy type aliases and constants for architectures that do not implement vector registers.
bool operator==(const DummyVecRegContainer &d) const
bool operator!=(const DummyVecRegContainer &d) const
static bool parse(const std::string &s, DummyVecRegContainer &value)
static bool parse(const std::string &str, VecRegContainer< Sz > &value)
static void show(std::ostream &os, const VecRegContainer< Sz > &value)