141 w->computeUnit->vectorRegsReserved[
w->simdId] -=
w->reservedVectorRegs;
143 w->computeUnit->scalarRegsReserved[
w->simdId] -=
w->reservedScalarRegs;
145 panic_if(
w->computeUnit->vectorRegsReserved[
w->simdId] < 0,
146 "Freeing VRF[%d] registers left %d registers reserved\n",
148 w->computeUnit->vectorRegsReserved[
w->simdId]);
149 panic_if(
w->computeUnit->scalarRegsReserved[
w->simdId] < 0,
150 "Freeing SRF[%d] registers left %d registers reserved\n",
152 w->computeUnit->scalarRegsReserved[
w->simdId]);
155 int endIndex =
w->startVgprIndex +
w->reservedVectorRegs;
157 w->computeUnit->registerManager->vrfPoolMgrs[
w->simdId]->
158 freeRegion(
w->startVgprIndex, endIndex);
161 for (
int i = 0;
i <
w->reservedVectorRegs;
i++) {
163 w->computeUnit->vrf[
w->simdId]->markReg(physVgprIdx,
false);
166 w->reservedVectorRegs = 0;
167 w->startVgprIndex = 0;
169 endIndex =
w->startSgprIndex +
w->reservedScalarRegs;
170 w->computeUnit->registerManager->srfPoolMgrs[
w->simdId]->
171 freeRegion(
w->startSgprIndex, endIndex);
174 for (
int i = 0;
i <
w->reservedScalarRegs;
i++) {
176 w->computeUnit->srf[
w->simdId]->markReg(physSgprIdx,
false);
179 w->reservedScalarRegs = 0;
180 w->startSgprIndex = 0;