gem5  v22.1.0.0
vec.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2011, 2014, 2016-2019 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2007-2008 The Florida State University
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #ifndef __ARCH_ARM_REGS_VEC_HH__
42 #define __ARCH_ARM_REGS_VEC_HH__
43 
44 #include "arch/arm/types.hh"
46 #include "arch/generic/vec_reg.hh"
47 #include "cpu/reg_class.hh"
48 #include "debug/VecPredRegs.hh"
49 #include "debug/VecRegs.hh"
50 
51 namespace gem5
52 {
53 
54 namespace ArmISA
55 {
56 
57 // Number of VecElem per Vector Register considering only pre-SVE
58 // Advanced SIMD registers.
59 constexpr unsigned NumVecElemPerNeonVecReg = 4;
60 // Number of VecElem per Vector Register, computed based on the vector length
62 
63 using VecElem = uint32_t;
66 
67 using VecPredReg =
72 
73 // Vec, PredVec
74 // NumFloatV7ArchRegs: This in theory should be 32.
75 // However in A32 gem5 is splitting double register accesses in two
76 // subsequent single register ones. This means we would use a index
77 // bigger than 31 when accessing D16-D31.
78 const int NumFloatV7ArchRegs = 64; // S0-S31, D0-D31
79 const int NumVecV7ArchRegs = 16; // Q0-Q15
80 const int NumVecV8ArchRegs = 32; // V0-V31
81 const int NumVecSpecialRegs = 8;
82 const int NumVecIntrlvRegs = 4;
84 const int NumVecPredRegs = 18; // P0-P15, FFR, UREG0
85 
86 // Vec, PredVec indices
89 const int INTRLVREG1 = INTRLVREG0 + 1;
90 const int INTRLVREG2 = INTRLVREG0 + 2;
91 const int INTRLVREG3 = INTRLVREG0 + 3;
92 const int VECREG_UREG0 = 32;
93 const int PREDREG_FFR = 16;
94 const int PREDREG_UREG0 = 17;
95 
100 
101 inline constexpr RegClass vecRegClass =
102  RegClass(VecRegClass, VecRegClassName, NumVecRegs, debug::VecRegs).
103  ops(vecRegClassOps).
104  regType<VecRegContainer>();
105 inline constexpr RegClass vecElemClass =
107  debug::VecRegs).
108  ops(vecRegElemClassOps);
109 inline constexpr RegClass vecPredRegClass =
111  debug::VecPredRegs).
112  ops(vecPredRegClassOps).
113  regType<VecPredRegContainer>();
114 
115 } // namespace ArmISA
116 } // namespace gem5
117 
118 #endif
Predicate register view.
Definition: vec_pred_reg.hh:74
typename std::conditional_t< Const, const VecPredRegContainer< NUM_BITS, Packed >, VecPredRegContainer< NUM_BITS, Packed > > Container
Container type alias.
Definition: vec_pred_reg.hh:85
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition: vec_reg.hh:124
const int NumVecV8ArchRegs
Definition: vec.hh:80
const int INTRLVREG3
Definition: vec.hh:91
const int INTRLVREG1
Definition: vec.hh:89
const int NumVecPredRegs
Definition: vec.hh:84
const int VecSpecialElem
Definition: vec.hh:87
static TypedRegClassOps< ArmISA::VecRegContainer > vecRegClassOps
Definition: vec.hh:98
VecPredReg::Container VecPredRegContainer
Definition: vec.hh:71
const int NumVecIntrlvRegs
Definition: vec.hh:82
constexpr unsigned NumVecElemPerVecReg
Definition: vec.hh:61
const int NumFloatV7ArchRegs
Definition: vec.hh:78
constexpr RegClass vecElemClass
Definition: vec.hh:105
const int NumVecV7ArchRegs
Definition: vec.hh:79
const int VECREG_UREG0
Definition: vec.hh:92
constexpr unsigned MaxSveVecLenInWords
Definition: types.hh:469
constexpr unsigned NumVecElemPerNeonVecReg
Definition: vec.hh:59
const int NumVecRegs
Definition: vec.hh:83
constexpr RegClass vecPredRegClass
Definition: vec.hh:109
static TypedRegClassOps< ArmISA::VecPredRegContainer > vecPredRegClassOps
Definition: vec.hh:99
const int PREDREG_FFR
Definition: vec.hh:93
const int NumVecSpecialRegs
Definition: vec.hh:81
static VecElemRegClassOps< ArmISA::VecElem > vecRegElemClassOps(NumVecElemPerVecReg)
const int PREDREG_UREG0
Definition: vec.hh:94
const int INTRLVREG2
Definition: vec.hh:90
constexpr RegClass vecRegClass
Definition: vec.hh:101
const int INTRLVREG0
Definition: vec.hh:88
uint32_t VecElem
Definition: vec.hh:63
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
constexpr char VecPredRegClassName[]
Definition: reg_class.hh:77
constexpr char VecRegClassName[]
Definition: reg_class.hh:75
@ VecPredRegClass
Definition: reg_class.hh:66
@ VecRegClass
Vector Register.
Definition: reg_class.hh:63
@ VecElemClass
Vector Register Native Elem lane.
Definition: reg_class.hh:65
constexpr char VecElemClassName[]
Definition: reg_class.hh:76
Vector Registers layout specification.

Generated on Wed Dec 21 2022 10:22:27 for gem5 by doxygen 1.9.1