Skip to content

Commit 6e88319

Browse files
mkarigansys_zuul
authored andcommitted
Changes in code.
Change-Id: I1a9a4f7695ace86c7cd158f2b296988077bb991d
1 parent f0a36c5 commit 6e88319

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

visa/G4Verifier.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -796,18 +796,6 @@ void G4Verifier::verifyOpnd(G4_Operand* opnd, G4_INST* inst)
796796
}
797797
}
798798
}
799-
800-
// if src0 is V/UV/VF imm, dst must be 16 byte aligned.
801-
if (inst->opcode() == G4_mov && IS_VTYPE(inst->getSrc(0)->getType()))
802-
{
803-
auto dst = inst->getDst();
804-
// should we assert if dst is not phyReg assigned?
805-
bool dstIsAssigned = dst->getBase()->isRegVar() && dst->getBase()->asRegVar()->isPhyRegAssigned();
806-
if (dstIsAssigned && dst->getLinearizedStart() % 16 != 0)
807-
{
808-
assert(false && "destination of move instruction with V/VF imm is not 16-byte aligned");
809-
}
810-
}
811799
}
812800
}
813801
}

visa/LocalRA.cpp

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,29 +2311,43 @@ bool PhyRegsLocalRA::findFreeSingleReg(int regIdx, G4_SubReg_Align subalign, int
23112311
found = true;
23122312
}
23132313
}
2314-
else
2314+
else if (subalign == Eight_Word || subalign == Four_Word)
23152315
{
2316-
// ToDo: check if dynamic step size has compile time impact
2317-
int step = 1;
2318-
switch (subalign)
2316+
for (int j = 0; j < (NUM_WORDS_PER_GRF - size + 1) && found == false; j += 4)
23192317
{
2320-
case Eight_Word: step = 8; break;
2321-
case Four_Word: step = 4; break;
2322-
case Even_Word: step = 2; break;
2323-
case Any: step = 1; break;
2324-
default:
2325-
assert("unexpected alignment");
2318+
if (isWordBusy(regIdx, j, size) == false)
2319+
{
2320+
subregnum = j;
2321+
found = true;
2322+
}
23262323
}
2327-
for (int j = 0; j + size <= NUM_WORDS_PER_GRF; j += step)
2324+
}
2325+
else if (subalign == Even_Word)
2326+
{
2327+
for (int j = 0; j < (NUM_WORDS_PER_GRF - size + 1) && found == false; j += 2)
23282328
{
2329-
if (!isWordBusy(regIdx, j, size))
2329+
if (isWordBusy(regIdx, j, size) == false)
23302330
{
23312331
subregnum = j;
23322332
found = true;
2333-
break;
23342333
}
23352334
}
23362335
}
2336+
else if (subalign == Any)
2337+
{
2338+
for (int j = 0; j < (NUM_WORDS_PER_GRF - size) && found == false; j++)
2339+
{
2340+
if (isWordBusy(regIdx, j, size) == false)
2341+
{
2342+
subregnum = j;
2343+
found = true;
2344+
}
2345+
}
2346+
}
2347+
else
2348+
{
2349+
ASSERT_USER(false, "Dont know how to allocate this sub-alignment");
2350+
}
23372351

23382352
if (found)
23392353
{

0 commit comments

Comments
 (0)