diff options
Diffstat (limited to 'src/cpu/inst_res.hh')
-rw-r--r-- | src/cpu/inst_res.hh | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/cpu/inst_res.hh b/src/cpu/inst_res.hh index 9b6a23d95..bf9c649ef 100644 --- a/src/cpu/inst_res.hh +++ b/src/cpu/inst_res.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 ARM Limited + * Copyright (c) 2016-2017 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -48,12 +48,14 @@ class InstResult { using VecRegContainer = TheISA::VecRegContainer; using VecElem = TheISA::VecElem; + using VecPredRegContainer = TheISA::VecPredRegContainer; public: union MultiResult { uint64_t integer; double dbl; VecRegContainer vector; VecElem vecElem; + VecPredRegContainer pred; MultiResult() {} }; @@ -61,6 +63,7 @@ class InstResult { Scalar, VecElem, VecReg, + VecPredReg, NumResultTypes, Invalid }; @@ -87,6 +90,9 @@ class InstResult { /** Vector result. */ explicit InstResult(const VecRegContainer& v, const ResultType& t) : type(t) { result.vector = v; } + /** Predicate result. */ + explicit InstResult(const VecPredRegContainer& v, const ResultType& t) + : type(t) { result.pred = v; } InstResult& operator=(const InstResult& that) { type = that.type; @@ -104,6 +110,10 @@ class InstResult { case ResultType::VecReg: result.vector = that.result.vector; break; + case ResultType::VecPredReg: + result.pred = that.result.pred; + break; + default: panic("Assigning result from unknown result type"); break; @@ -124,6 +134,8 @@ class InstResult { return result.vecElem == that.result.vecElem; case ResultType::VecReg: return result.vector == that.result.vector; + case ResultType::VecPredReg: + return result.pred == that.result.pred; case ResultType::Invalid: return false; default: @@ -143,6 +155,8 @@ class InstResult { bool isVector() const { return type == ResultType::VecReg; } /** Is this a vector element result?. */ bool isVecElem() const { return type == ResultType::VecElem; } + /** Is this a predicate result?. */ + bool isPred() const { return type == ResultType::VecPredReg; } /** Is this a valid result?. */ bool isValid() const { return type != ResultType::Invalid; } /** @} */ @@ -177,6 +191,14 @@ class InstResult { panic_if(!isVecElem(), "Converting scalar (or invalid) to vector!!"); return result.vecElem; } + + const VecPredRegContainer& + asPred() const + { + panic_if(!isPred(), "Converting scalar (or invalid) to predicate!!"); + return result.pred; + } + /** @} */ }; |