diff options
author | Giacomo Gabrielli <giacomo.gabrielli@arm.com> | 2018-10-16 16:04:08 +0100 |
---|---|---|
committer | Giacomo Gabrielli <giacomo.gabrielli@arm.com> | 2019-01-30 16:57:54 +0000 |
commit | 25474167e5b247d1b91fbf802c5b396a63ae705e (patch) | |
tree | b509597b23d792734f55c33b8125eebfbd9cd3a5 /src/arch/riscv/registers.hh | |
parent | c6f5db8743f19b02a38146d9cf2a829883387008 (diff) | |
download | gem5-25474167e5b247d1b91fbf802c5b396a63ae705e.tar.xz |
arch,cpu: Add vector predicate registers
Latest-gen. vector/SIMD extensions, including the Arm Scalable Vector
Extension (SVE), introduce the notion of a predicate register file.
This changeset adds this feature across architectures and CPU models.
Change-Id: Iebcadbad89c0a582ff8b1b70de353305db603946
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/13715
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/riscv/registers.hh')
-rw-r--r-- | src/arch/riscv/registers.hh | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/arch/riscv/registers.hh b/src/arch/riscv/registers.hh index 2de154e22..a67274221 100644 --- a/src/arch/riscv/registers.hh +++ b/src/arch/riscv/registers.hh @@ -52,6 +52,7 @@ #include <vector> #include "arch/generic/types.hh" +#include "arch/generic/vec_pred_reg.hh" #include "arch/generic/vec_reg.hh" #include "arch/isa_traits.hh" #include "arch/riscv/generated/max_inst_regs.hh" @@ -68,19 +69,31 @@ typedef RegVal FloatRegBits; typedef uint8_t CCReg; // Not applicable to Riscv typedef RegVal MiscReg; -// dummy typedefs since we don't have vector regs -const unsigned NumVecElemPerVecReg = 2; -using VecElem = uint32_t; -using VecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, false>; -using ConstVecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, true>; -using VecRegContainer = VecReg::Container; +// Not applicable to RISC-V +using VecElem = ::DummyVecElem; +using VecReg = ::DummyVecReg; +using ConstVecReg = ::DummyConstVecReg; +using VecRegContainer = ::DummyVecRegContainer; +constexpr unsigned NumVecElemPerVecReg = ::DummyNumVecElemPerVecReg; +constexpr size_t VecRegSizeBytes = ::DummyVecRegSizeBytes; + +// Not applicable to RISC-V +using VecPredReg = ::DummyVecPredReg; +using ConstVecPredReg = ::DummyConstVecPredReg; +using VecPredRegContainer = ::DummyVecPredRegContainer; +constexpr size_t VecPredRegSizeBits = ::DummyVecPredRegSizeBits; +constexpr bool VecPredRegHasPackedRepr = ::DummyVecPredRegHasPackedRepr; const int NumIntArchRegs = 32; const int NumMicroIntRegs = 1; const int NumIntRegs = NumIntArchRegs + NumMicroIntRegs; const int NumFloatRegs = 32; -// This has to be one to prevent warnings that are treated as errors -const unsigned NumVecRegs = 1; + +const unsigned NumVecRegs = 1; // Not applicable to RISC-V + // (1 to prevent warnings) +const int NumVecPredRegs = 1; // Not applicable to RISC-V + // (1 to prevent warnings) + const int NumCCRegs = 0; // Semantically meaningful register indices |