@@ -2539,7 +2539,7 @@ void GlobalRA::updateSubRegAlignment(unsigned char regFile, G4_SubReg_Align subA
2539
2539
else if (!areAllDefsNoMask (topdcl) &&
2540
2540
getAugmentationMask (topdcl) != AugmentationMasks::NonDefault)
2541
2541
{
2542
- dcl->setSubRegAlign (Sixteen_Word );
2542
+ dcl->setSubRegAlign (subAlign );
2543
2543
}
2544
2544
}
2545
2545
}
@@ -2841,7 +2841,7 @@ void Augmentation::updateDstMask(G4_INST* inst, bool checkCmodOnly)
2841
2841
elemSize = 1 ;
2842
2842
}
2843
2843
2844
- startByte = (row * 32 ) + (subReg * elemSize);
2844
+ startByte = (row * getGRFSize () ) + (subReg * elemSize);
2845
2845
2846
2846
if (dst->isFlag ())
2847
2847
{
@@ -4706,7 +4706,7 @@ void Augmentation::augmentIntfGraph()
4706
4706
#endif
4707
4707
gra.updateAlignment (G4_GRF, Even);
4708
4708
}
4709
- gra.updateSubRegAlignment (G4_GRF, Sixteen_Word );
4709
+ gra.updateSubRegAlignment (G4_GRF, SUB_ALIGNMENT_GRFALIGN );
4710
4710
}
4711
4711
4712
4712
// Clear information calculated in this iteration of RA so
@@ -6115,7 +6115,7 @@ bool GraphColor::regAlloc(bool doBankConflictReduction,
6115
6115
//
6116
6116
if (dcl->getNumRows () > 1 )
6117
6117
{
6118
- lrs[i]->getVar ()->setSubRegAlignment (Sixteen_Word );
6118
+ lrs[i]->getVar ()->setSubRegAlignment (SUB_ALIGNMENT_GRFALIGN );
6119
6119
}
6120
6120
//
6121
6121
// single-row
@@ -6512,7 +6512,7 @@ void GraphColor::saveRegs(
6512
6512
0 , 0 , builder.rgnpool .createRegion (8 , 8 , 1 ), Type_UD);
6513
6513
unsigned messageLength = owordSize / 2 ;
6514
6514
G4_Declare *msgDcl = builder.createTempVar (messageLength * GENX_DATAPORT_IO_SZ,
6515
- Type_UD, Either, Sixteen_Word , StackCallStr);
6515
+ Type_UD, Either, SUB_ALIGNMENT_GRFALIGN , StackCallStr);
6516
6516
msgDcl->getRegVar ()->setPhyReg (regPool.getGreg (startReg), 0 );
6517
6517
auto sendSrc2 = builder.createSrcRegRegion (Mod_src_undef, Direct, msgDcl->getRegVar (), 0 , 0 ,
6518
6518
builder.rgnpool .createRegion (8 , 8 , 1 ), Type_UD);
@@ -6637,7 +6637,7 @@ void GraphColor::restoreRegs(
6637
6637
6638
6638
unsigned responseLength = ROUND (owordSize, 2 ) / 2 ;
6639
6639
G4_Declare *dstDcl = builder.createTempVar (responseLength * GENX_DATAPORT_IO_SZ,
6640
- Type_UD, Either, Sixteen_Word , GraphColor::StackCallStr);
6640
+ Type_UD, Either, SUB_ALIGNMENT_GRFALIGN , GraphColor::StackCallStr);
6641
6641
dstDcl->getRegVar ()->setPhyReg (regPool.getGreg (startReg), 0 );
6642
6642
G4_DstRegRegion* postDst = builder.createDstRegRegion (Direct, dstDcl->getRegVar (), 0 , 0 , 1 , (execSize > 8 ) ? Type_UW : Type_UD);
6643
6643
G4_SrcRegRegion* payload = builder.Create_Src_Opnd_From_Dcl (scratchRegDcl, builder.getRegionStride1 ());
@@ -7013,7 +7013,7 @@ void GraphColor::addCallerSaveRestoreCode()
7013
7013
{
7014
7014
std::ofstream optreport;
7015
7015
getOptReportStream (optreport, m_options);
7016
- optreport << " Caller save size: " << callerSaveRegCount * 32 <<
7016
+ optreport << " Caller save size: " << callerSaveRegCount * getGRFSize () <<
7017
7017
" bytes for fcall at cisa id " <<
7018
7018
(*it)->back ()->getCISAOff () << std::endl;
7019
7019
closeOptReportStream (optreport);
@@ -7143,7 +7143,7 @@ void GraphColor::addCalleeSaveRestoreCode()
7143
7143
{
7144
7144
std::ofstream optreport;
7145
7145
getOptReportStream (optreport, m_options);
7146
- optreport << " Callee save size: " << calleeSaveRegCount * 32 <<
7146
+ optreport << " Callee save size: " << calleeSaveRegCount * getGRFSize () <<
7147
7147
" bytes" << std::endl;
7148
7148
closeOptReportStream (optreport);
7149
7149
}
@@ -10987,7 +10987,6 @@ void GraphColor::dumpRegisterPressure()
10987
10987
}
10988
10988
}
10989
10989
10990
-
10991
10990
// FIXME: is any of this necessary? If they are they should be moved to HWConformity, is the concern
10992
10991
// that new variables created by lvn/spill/remat may not honor alignment requirements?
10993
10992
void GlobalRA::fixAlignment ()
@@ -11001,13 +11000,14 @@ void GlobalRA::fixAlignment()
11001
11000
{
11002
11001
G4_RegVar* var = dst->getBase ()->asRegVar ();
11003
11002
// dst register on sendin must be whole register aligned.
11003
+ // NOTE THAT: The assumption is that the previous pass will set only SUB_ALIGNMENT_HALFGRFALIGN or whole GRF align
11004
11004
if (inst->isSend () && dst->getRegAccess () == Direct) {
11005
11005
if (!var->isPhyRegAssigned () &&
11006
11006
(var->getDeclare ()->getSubRegAlign () == Any ||
11007
- var->getDeclare ()->getSubRegAlign () == Even_Word ||
11008
- var->getDeclare ()->getSubRegAlign () == Eight_Word ))
11007
+ var->getDeclare ()->getSubRegAlign () == Even_Word ||
11008
+ var->getDeclare ()->getSubRegAlign () == SUB_ALIGNMENT_HALFGRFALIGN ))
11009
11009
{
11010
- var->setSubRegAlignment (Sixteen_Word );
11010
+ var->setSubRegAlignment (SUB_ALIGNMENT_GRFALIGN );
11011
11011
}
11012
11012
}
11013
11013
@@ -11025,13 +11025,13 @@ void GlobalRA::fixAlignment()
11025
11025
if (inst->isAccSrcInst ())
11026
11026
{
11027
11027
if (var->getDeclare ()->getRegFile () != G4_ADDRESS)
11028
- var->setSubRegAlignment (Sixteen_Word );
11028
+ var->setSubRegAlignment (SUB_ALIGNMENT_GRFALIGN );
11029
11029
else
11030
- var->setSubRegAlignment (Eight_Word );
11030
+ var->setSubRegAlignment (SUB_ALIGNMENT_HALFGRFALIGN );
11031
11031
}
11032
- else if (var->getSubRegAlignment () != Sixteen_Word )
11032
+ else if (var->getSubRegAlignment () != SUB_ALIGNMENT_GRFALIGN )
11033
11033
{
11034
- if (inst->opcode () == G4_movi)
11034
+ if (inst->opcode () == G4_movi) // FIXME: restriction for movi, what about 64 bytes GRF
11035
11035
{
11036
11036
G4_Type dstType = dst->getType ();
11037
11037
switch (G4_Type_Table[dstType].byteSize )
@@ -11079,7 +11079,8 @@ void GlobalRA::fixAlignment()
11079
11079
11080
11080
G4_SubReg_Align dstSubAlign = var->getSubRegAlignment ();
11081
11081
if (dstSubAlign != Eight_Word &&
11082
- dstSubAlign != Sixteen_Word)
11082
+ dstSubAlign != Sixteen_Word
11083
+ )
11083
11084
{
11084
11085
for (unsigned j = 0 ; j < G4_MAX_SRCS; j++)
11085
11086
{
0 commit comments