40 #ifndef __CPU_INST_RES_HH__ 41 #define __CPU_INST_RES_HH__ 43 #include <type_traits> 82 static_assert(std::is_integral<T>::value ^
83 std::is_floating_point<T>::value,
84 "Parameter type is neither integral nor fp, or it is both");
85 if (std::is_integral<T>::value) {
87 }
else if (std::is_floating_point<T>::value) {
93 : type(t) { result.
vector =
v; }
96 : type(t) { result.
pred =
v; }
119 panic(
"Assigning result from unknown result type");
129 if (this->type != that.
type)
143 panic(
"Unknown type of result: %d\n", (
int)type);
199 panic_if(!
isPred(),
"Converting scalar (or invalid) to predicate!!");
206 #endif // __CPU_INST_RES_HH__ const uint64_t & asInteger() const
Explicit cast-like operations.
#define panic(...)
This implements a cprintf based panic() function.
const VecElem & asVectorElem() const
Vector Register Abstraction This generic class is the model in a particularization of MVC...
bool operator==(const InstResult &that) const
Result comparison Two invalid results always differ.
InstResult()
Default constructor creates an invalid result.
InstResult & operator=(const InstResult &that)
bool isVector() const
Is this a vector result?.
::DummyVecPredRegContainer VecPredRegContainer
::DummyVecRegContainer VecRegContainer
bool isScalar() const
Checks.
InstResult(const VecPredRegContainer &v, const ResultType &t)
Predicate result.
const VecRegContainer & asVector() const
InstResult(const VecRegContainer &v, const ResultType &t)
Vector result.
Vector Registers layout specification.
Generic predicate register container.
InstResult(T i, const ResultType &t)
Scalar result from scalar.
bool isVecElem() const
Is this a vector element result?.
bool isValid() const
Is this a valid result?.
const VecPredRegContainer & asPred() const
bool isPred() const
Is this a predicate result?.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
bool operator!=(const InstResult &that) const
const uint64_t & asIntegerNoAssert() const
Cast to integer without checking type.