Deleted Added
sdiff udiff text old ( 12109:f29e9c5418aa ) new ( 13610:5d5404ac6288 )
full compact
1/*
2 * Copyright (c) 2016 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

--- 36 unchanged lines hidden (view full) ---

47
48#include "cpu/o3/free_list.hh"
49#include "arch/generic/types.hh"
50#include "cpu/o3/free_list.hh"
51
52PhysRegFile::PhysRegFile(unsigned _numPhysicalIntRegs,
53 unsigned _numPhysicalFloatRegs,
54 unsigned _numPhysicalVecRegs,
55 unsigned _numPhysicalCCRegs,
56 VecMode vmode)
57 : intRegFile(_numPhysicalIntRegs),
58 floatRegFile(_numPhysicalFloatRegs),
59 vectorRegFile(_numPhysicalVecRegs),
60 ccRegFile(_numPhysicalCCRegs),
61 numPhysicalIntRegs(_numPhysicalIntRegs),
62 numPhysicalFloatRegs(_numPhysicalFloatRegs),
63 numPhysicalVecRegs(_numPhysicalVecRegs),
64 numPhysicalVecElemRegs(_numPhysicalVecRegs *
65 NumVecElemPerVecReg),
66 numPhysicalCCRegs(_numPhysicalCCRegs),
67 totalNumRegs(_numPhysicalIntRegs
68 + _numPhysicalFloatRegs
69 + _numPhysicalVecRegs
70 + _numPhysicalVecRegs * NumVecElemPerVecReg
71 + _numPhysicalCCRegs),
72 vecMode(vmode)
73{
74 PhysRegIndex phys_reg;
75 PhysRegIndex flat_reg_idx = 0;
76
77 if (TheISA::NumCCRegs == 0 && _numPhysicalCCRegs != 0) {
78 // Just make this a warning and go ahead and allocate them

--- 24 unchanged lines hidden (view full) ---

103 // them; put them onto the vector free list.
104 for (phys_reg = 0; phys_reg < numPhysicalVecRegs; phys_reg++) {
105 for (ElemIndex eIdx = 0; eIdx < NumVecElemPerVecReg; eIdx++) {
106 vecElemIds.emplace_back(VecElemClass, phys_reg,
107 eIdx, flat_reg_idx++);
108 }
109 }
110
111 // The rest of the registers are the condition-code physical
112 // registers; put them onto the condition-code free list.
113 for (phys_reg = 0; phys_reg < numPhysicalCCRegs; phys_reg++) {
114 ccRegIds.emplace_back(CCRegClass, phys_reg, flat_reg_idx++);
115 }
116
117 // Misc regs have a fixed mapping but still need PhysRegIds.
118 for (phys_reg = 0; phys_reg < TheISA::NumMiscRegs; phys_reg++) {

--- 35 unchanged lines hidden (view full) ---

154
155 /* depending on the mode we add the vector registers as whole units or
156 * as different elements. */
157 if (vecMode == Enums::Full)
158 freeList->addRegs(vecRegIds.begin(), vecRegIds.end());
159 else
160 freeList->addRegs(vecElemIds.begin(), vecElemIds.end());
161
162 // The rest of the registers are the condition-code physical
163 // registers; put them onto the condition-code free list.
164 for (reg_idx = 0; reg_idx < numPhysicalCCRegs; reg_idx++) {
165 assert(ccRegIds[reg_idx].index() == reg_idx);
166 }
167 freeList->addRegs(ccRegIds.begin(), ccRegIds.end());
168}
169

--- 16 unchanged lines hidden (view full) ---

186 case IntRegClass:
187 return std::make_pair(intRegIds.begin(), intRegIds.end());
188 case FloatRegClass:
189 return std::make_pair(floatRegIds.begin(), floatRegIds.end());
190 case VecRegClass:
191 return std::make_pair(vecRegIds.begin(), vecRegIds.end());
192 case VecElemClass:
193 return std::make_pair(vecElemIds.begin(), vecElemIds.end());
194 case CCRegClass:
195 return std::make_pair(ccRegIds.begin(), ccRegIds.end());
196 case MiscRegClass:
197 return std::make_pair(miscRegIds.begin(), miscRegIds.end());
198 }
199 /* There is no way to make an empty iterator */
200 return std::make_pair(PhysIds::const_iterator(),
201 PhysIds::const_iterator());

--- 18 unchanged lines hidden ---