Skip to content

Commit cca04b2

Browse files
trbauerpaigeale
authored andcommitted
Internal feature
Change-Id: Ida2a0d6d00fa3effaa0096a799ab45fe1bdd0b75
1 parent ec53754 commit cca04b2

19 files changed

+682
-647
lines changed

visa/BinaryEncoding.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ inline void EncodeSrc0ChanSelect( G4_INST *inst,
10871087
ASSERT_USER(false, "acc2~acc7 were set on wrong instruction");
10881088
}
10891089

1090-
char *swizzle = srcRegion->getSwizzle();
1090+
const char *swizzle = srcRegion->getSwizzle();
10911091
if (swizzle[0] != '\0' && swizzle[0] != 'r') {
10921092
ChanSel ch0 = EncodingHelper::GetSrcChannelSelectValue(srcRegion, 0);
10931093
ChanSel ch1 = EncodingHelper::GetSrcChannelSelectValue(srcRegion, 1);
@@ -1130,7 +1130,7 @@ inline void EncodeSrc0ChanSelect( G4_INST *inst,
11301130

11311131
inline void EncodeSrc0RepCtrl(BinInst *mybin, G4_SrcRegRegion *srcRegion)
11321132
{
1133-
char *swizzle = srcRegion->getSwizzle();
1133+
const char *swizzle = srcRegion->getSwizzle();
11341134
if (swizzle[0] == 'r')
11351135
SetSrc0RepCtrl(mybin, 0x1);
11361136
else
@@ -1844,7 +1844,7 @@ inline void EncodeSrc1ChanSelect(G4_INST *inst, BinInst *mybin, G4_SrcRegRegion
18441844
ASSERT_USER(false, "acc2~acc7 were set on wrong instruction");
18451845
}
18461846

1847-
char *swizzle = srcRegion->getSwizzle();
1847+
const char *swizzle = srcRegion->getSwizzle();
18481848
if (swizzle[0] != '\0' && swizzle[0] != 'r') {
18491849
ChanSel ch0 = EncodingHelper::GetSrcChannelSelectValue(srcRegion, 0);
18501850
ChanSel ch1 = EncodingHelper::GetSrcChannelSelectValue(srcRegion, 1);
@@ -1887,7 +1887,7 @@ inline void EncodeSrc1ChanSelect(G4_INST *inst, BinInst *mybin, G4_SrcRegRegion
18871887

18881888
inline void EncodeSrc1RepCtrl(BinInst *mybin, G4_SrcRegRegion *srcRegion)
18891889
{
1890-
char *swizzle = srcRegion->getSwizzle();
1890+
const char *swizzle = srcRegion->getSwizzle();
18911891
if (swizzle[0] == 'r')
18921892
SetSrc1RepCtrl(mybin, 0x1);
18931893
else
@@ -2476,7 +2476,7 @@ inline void EncodeSrc2ChanSelect( G4_INST *inst,
24762476
ASSERT_USER(false, "acc2~acc7 were set on wrong instruction");
24772477
}
24782478

2479-
char *swizzle = srcRegion->getSwizzle();
2479+
const char *swizzle = srcRegion->getSwizzle();
24802480
{
24812481
if (swizzle[0] != '\0' && swizzle[0] != 'r')
24822482
{
@@ -2510,7 +2510,7 @@ inline void EncodeSrc2ChanSelect( G4_INST *inst,
25102510

25112511
inline void EncodeSrc2RepCtrl(BinInst *mybin, G4_SrcRegRegion *srcRegion)
25122512
{
2513-
char *swizzle = srcRegion->getSwizzle();
2513+
const char *swizzle = srcRegion->getSwizzle();
25142514
if (swizzle[0] == 'r')
25152515
SetSrc2RepCtrl(mybin, 0x1);
25162516
else

visa/BinaryEncodingCNL.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ class SrcBuilder
979979
T *myBin,
980980
G4_SrcRegRegion *srcRegion )
981981
{
982-
char *swizzle = srcRegion->getSwizzle();
982+
const char *swizzle = srcRegion->getSwizzle();
983983
if (swizzle[0] == 'r')
984984
SrcOperandEncoder<T, SrcNum>::SrcReplicateControl(myBin, G9HDL::REPCTRL_REPLICATE_ACROSS_ALL_CHANNELS );
985985
else
@@ -1010,7 +1010,7 @@ class SrcBuilder
10101010
ASSERT_USER(false, "acc2~acc7 were set on wrong instruction");
10111011
}
10121012

1013-
char *swizzle = srcRegion->getSwizzle();
1013+
const char *swizzle = srcRegion->getSwizzle();
10141014
if (swizzle[0] != '\0' && swizzle[0] != 'r') {
10151015
ChanSelectValid = true;
10161016
ChanSel ch0 = EncodingHelper::GetSrcChannelSelectValue(srcRegion, 0);

visa/BuildIR.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class IR_Builder {
338338

339339
public:
340340

341-
char* curFile;
341+
const char* curFile;
342342
unsigned int curLine;
343343
int curCISAOffset;
344344

@@ -654,7 +654,7 @@ class IR_Builder {
654654

655655
PVISA_WA_TABLE getPWaTable() { return m_pWaTable; }
656656

657-
char* getNameString(Mem_Manager& mem, size_t size, const char* format, ...)
657+
const char* getNameString(Mem_Manager& mem, size_t size, const char* format, ...)
658658
{
659659
#ifdef _DEBUG
660660
char* name = (char*) mem.alloc(size);
@@ -997,7 +997,8 @@ class IR_Builder {
997997
// create a new temp GRF with the specified type/size and undefined regions
998998
G4_Declare* createTempVar(unsigned int numElements, G4_Type type, G4_Align align, G4_SubReg_Align subAlign, const char* prefix = "TV", bool appendIdToName = true )
999999
{
1000-
char* name = appendIdToName ? getNameString(mem, 20, "%s%d", prefix, num_temp_dcl++) :
1000+
const char* name = appendIdToName ?
1001+
getNameString(mem, 20, "%s%d", prefix, num_temp_dcl++) :
10011002
getNameString(mem, 20, "%s", prefix);
10021003

10031004
unsigned short dcl_width = 0, dcl_height = 1;
@@ -1027,7 +1028,7 @@ class IR_Builder {
10271028
// create a new temp GRF as the home location of a spilled addr/flag dcl
10281029
G4_Declare* createAddrFlagSpillLoc(G4_Declare* dcl)
10291030
{
1030-
char* name = getNameString(mem, 16, "SP_LOC_%d", numAddrFlagSpillLoc++);
1031+
const char* name = getNameString(mem, 16, "SP_LOC_%d", numAddrFlagSpillLoc++);
10311032
G4_Declare* spillLoc = createDeclareNoLookup(name,
10321033
G4_GRF,
10331034
dcl->getNumElems(),
@@ -1517,7 +1518,7 @@ class IR_Builder {
15171518
unsigned char size, G4_DstRegRegion* dst,
15181519
G4_Operand* src0, G4_Operand* src1,
15191520
unsigned int option, int lineno, int CISAoff,
1520-
char* srcFilename);
1521+
const char* srcFilename);
15211522

15221523
G4_INST* createInst(G4_Predicate* prd, G4_opcode op,
15231524
G4_CondMod* mod, bool sat,
@@ -1565,12 +1566,12 @@ class IR_Builder {
15651566
unsigned char size, G4_DstRegRegion* dst,
15661567
G4_Operand* src0, G4_Operand* src1, G4_Operand* src2,
15671568
unsigned int option, int lineno, int CISAoff,
1568-
char* srcFilename);
1569+
const char* srcFilename);
15691570

15701571
G4_INST* createInternalCFInst(G4_Predicate* prd, G4_opcode op,
15711572
unsigned char size, G4_Label* jip, G4_Label* uip,
15721573
unsigned int option, int lineno = 0, int CISAoff = -1,
1573-
char* srcFilename = NULL);
1574+
const char* srcFilename = NULL);
15741575

15751576

15761577
G4_InstSend* createSendInst(G4_Predicate* prd, G4_opcode op,
@@ -1587,7 +1588,7 @@ class IR_Builder {
15871588
G4_SendMsgDescriptor *msgDesc,
15881589
int lineno = 0,
15891590
int CISAoff = -1,
1590-
char* srcFilename = NULL);
1591+
const char* srcFilename = NULL);
15911592

15921593
G4_InstSend* createSplitSendInst(G4_Predicate* prd, G4_opcode op,
15931594
unsigned char size, G4_DstRegRegion* dst,
@@ -1606,7 +1607,7 @@ class IR_Builder {
16061607
G4_Operand* src3,
16071608
int lineno = 0,
16081609
int CISAoff = -1,
1609-
char* srcFilename = NULL);
1610+
const char* srcFilename = NULL);
16101611

16111612
G4_INST* createMathInst(G4_Predicate* prd, bool sat,
16121613
unsigned char size, G4_DstRegRegion* dst,
@@ -1617,7 +1618,7 @@ class IR_Builder {
16171618
unsigned char size, G4_DstRegRegion* dst,
16181619
G4_Operand* src0, G4_Operand* src1, G4_MathOp mathOp,
16191620
unsigned int option, int lineno = 0, int CISAoff = -1,
1620-
char* srcFilename = NULL);
1621+
const char* srcFilename = NULL);
16211622

16221623
G4_INST* createIntrinsicInst(G4_Predicate* prd, Intrinsic intrinId,
16231624
unsigned char size, G4_DstRegRegion* dst,
@@ -1628,7 +1629,7 @@ class IR_Builder {
16281629
unsigned char size, G4_DstRegRegion* dst,
16291630
G4_Operand* src0, G4_Operand* src1, G4_Operand* src2,
16301631
unsigned int option, int lineno = 0, int CISAoff = -1,
1631-
char* srcFilename = NULL);
1632+
const char* srcFilename = NULL);
16321633

16331634
G4_MathOp Get_MathFuncCtrl(ISA_Opcode op, G4_Type type);
16341635
void resizePredefinedStackVars();
@@ -2467,8 +2468,6 @@ class IR_Builder {
24672468

24682469
#define FIX_OWORD_SEND_EXEC_SIZE(BLOCK_SIZE)(((BLOCK_SIZE) > 2)? 16: (BLOCK_SIZE*4))
24692470

2470-
char * createNameSpace(uint8_t size){ return (char*)mem.alloc(size); }
2471-
24722471
// return either 253 or 255 for A64 messages, depending on whether we want I/A coherency or not
24732472
uint8_t getA64BTI() const { return m_options->getOption(vISA_noncoherentStateless) ? 0xFD : 0xFF; }
24742473

visa/BuildIRImpl.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ G4_INST* IR_Builder::createInternalInst(G4_Predicate* prd,
295295
G4_Operand* src1,
296296
unsigned int option,
297297
int lineno, int CISAoff,
298-
char* srcFilename)
298+
const char* srcFilename)
299299
{
300300
MUST_BE_TRUE(op != G4_math, "IR_Builder::createInternalInst should not be used to create math instructions");
301301

@@ -341,7 +341,7 @@ G4_INST* IR_Builder::createInternalCFInst(
341341
unsigned int option,
342342
int lineno,
343343
int CISAoff,
344-
char* srcFilename)
344+
const char* srcFilename)
345345
{
346346
MUST_BE_TRUE(G4_Inst_Table[op].instType == InstTypeFlow,
347347
"IR_Builder::createInternalCFInst must be used with InstTypeFlow instruction class");
@@ -437,7 +437,7 @@ G4_INST* IR_Builder::createInternalInst(G4_Predicate* prd,
437437
G4_Operand* src2,
438438
unsigned int option,
439439
int lineno, int CISAoff,
440-
char* srcFilename)
440+
const char* srcFilename)
441441
{
442442
auto ii = createInst(prd, op, mod, sat, size, dst, src0, src1, src2, option,
443443
lineno, false);
@@ -494,7 +494,7 @@ G4_InstSend* IR_Builder::createInternalSendInst(G4_Predicate* prd,
494494
G4_SendMsgDescriptor *msgDesc,
495495
int lineno,
496496
int CISAoff,
497-
char* srcFilename)
497+
const char* srcFilename)
498498
{
499499
auto ii = createSendInst(prd, op, size, postDst, currSrc,
500500
msg, option, msgDesc, lineno, false);
@@ -568,7 +568,7 @@ G4_InstSend* IR_Builder::createInternalSplitSendInst(G4_Predicate* prd,
568568
G4_Operand* src3, // ext msg desciptor: imm or vec
569569
int lineno,
570570
int CISAoff,
571-
char* srcFilename)
571+
const char* srcFilename)
572572
{
573573
auto ii = createSplitSendInst(prd, op, size, dst, src0, src1, msg, option,
574574
msgDesc, src3, lineno, false);
@@ -628,7 +628,7 @@ G4_INST* IR_Builder::createInternalMathInst(G4_Predicate* prd,
628628
unsigned int option,
629629
int lineno,
630630
int CISAoff,
631-
char* srcFilename)
631+
const char* srcFilename)
632632
{
633633
auto ii = createMathInst(prd, sat, size, dst, src0, src1, mathOp, option, lineno, false);
634634

@@ -669,7 +669,7 @@ G4_INST* IR_Builder::createIntrinsicInst(G4_Predicate* prd, Intrinsic intrinId,
669669
G4_INST* IR_Builder::createInternalIntrinsicInst(G4_Predicate* prd, Intrinsic intrinId,
670670
uint8_t size, G4_DstRegRegion* dst,
671671
G4_Operand* src0, G4_Operand* src1, G4_Operand* src2,
672-
unsigned int option, int lineno, int CISAoff, char* srcFilename)
672+
unsigned int option, int lineno, int CISAoff, const char* srcFilename)
673673
{
674674
auto ii = createIntrinsicInst(prd, intrinId, size, dst, src0, src1, src2, option,
675675
lineno, false);
@@ -763,7 +763,7 @@ G4_SrcRegRegion* IR_Builder::createBindlessExDesc(uint32_t exdesc)
763763
{
764764
// virtual var for each exdesc
765765
G4_SrcRegRegion* T252 = Create_Src_Opnd_From_Dcl(builtinT252, getRegionScalar());
766-
char* buf = getNameString(mem, 20, "ExDesc%d", num_temp_dcl++);
766+
const char* buf = getNameString(mem, 20, "ExDesc%d", num_temp_dcl++);
767767
G4_Declare* exDescDecl = createDeclareNoLookup(buf, G4_ADDRESS, 1, 1, Type_UD);
768768
exDescDecl->setSubRegAlign(Four_Word);
769769
G4_DstRegRegion* dst = Create_Dst_Opnd_From_Dcl(exDescDecl, 1);
@@ -1092,7 +1092,7 @@ G4_InstSend *IR_Builder::Create_SplitSend_Inst_For_RTWrite(G4_Predicate *pred,
10921092
// create a dcl for MRF, size in UD is given
10931093
G4_Declare* IR_Builder::Create_MRF_Dcl( unsigned num_elt, G4_Type type )
10941094
{
1095-
char* name = getNameString(mem, 16, "M%u", ++num_general_dcl);
1095+
const char* name = getNameString(mem, 16, "M%u", ++num_general_dcl);
10961096
unsigned short numRow = ( num_elt * G4_Type_Table[type].byteSize - 1 ) / GENX_MRF_REG_SIZ + 1;
10971097
unsigned short numElt = ( numRow == 1 ) ? num_elt : (GENX_MRF_REG_SIZ/G4_Type_Table[type].byteSize);
10981098
G4_Declare *dcl = createDeclareNoLookup(

visa/Common_BinaryEncoding.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ typedef enum _RegFile_
6363
REG_FILE_I
6464
} RegFile;
6565

66-
typedef enum _ArchRegFile_
66+
typedef enum _ArchRegFile_
6767
{ // (ARF Registers -- Overview):
6868
ARCH_REG_FILE_NULL = 0x00, // 0000 null Null register
6969
ARCH_REG_FILE_A = 0x01, // 0001 a0.# Address register
@@ -79,7 +79,7 @@ typedef enum _ArchRegFile_
7979
ARCH_REG_FILE_TDR_REG = 0x0B, // 1011 tdr Thread dependency register
8080
ARCH_REG_FILE_TM_REG = 0x0C, // 1100 tm0 TimeStamp register
8181
ARCH_REG_FILE_FC_REG = 0x0D, // 1101 fc#.# Flow Control register
82-
ARCH_REG_FILE_DBG_REG = 0x0F // 1111 dbg0 Debug only
82+
ARCH_REG_FILE_DBG_REG = 0x0F // 1111 dbg0 Debug only
8383
} ArchRegFile;
8484

8585
enum class Align1PredCtrl
@@ -190,7 +190,7 @@ namespace vISA
190190
{
191191
ChanSel ChanSelectValue = CHAN_SEL_UNDEF;
192192

193-
char *swizzle = srcRegion->getSwizzle();
193+
const char *swizzle = srcRegion->getSwizzle();
194194

195195
if (i < NUM_REGISTER_CHANNELS) {
196196
switch (swizzle[i]) {
@@ -215,7 +215,7 @@ namespace vISA
215215
{
216216
if (src->isSrcRegRegion())
217217
{
218-
char *swizzle = src->asSrcRegRegion()->getSwizzle();
218+
const char *swizzle = src->asSrcRegRegion()->getSwizzle();
219219
if (swizzle[0] != '\0')
220220
{
221221
if (swizzle[0] == 'r')
@@ -603,7 +603,7 @@ static uint32_t ICLCompactDataTypeTable[COMPACT_TABLE_SIZE] =
603603
0x40041, // 001000000000001000001
604604
0x400C1, // 001000000000011000001
605605
0x40165, // 001000000000101100101
606-
0x40BE5, // 001000000101111100101
606+
0x40BE5, // 001000000101111100101
607607
0x40941, // 001000000100101000001
608608
0x40945, // 001000000100101000101
609609
0x40965, // 001000000100101100101
@@ -618,7 +618,7 @@ static uint32_t ICLCompactDataTypeTable[COMPACT_TABLE_SIZE] =
618618
0x65964, // 001100101100101100100
619619
0x65965, // 001100101100101100101
620620
0x67964, // 001100111100101100100
621-
0x0040C, // 000000000010000001100
621+
0x0040C, // 000000000010000001100
622622
0x40065, // 001000000000001100101
623623
0x40145, // 001000000000101000101
624624
0x41040, // 001000001000001000000
@@ -1432,7 +1432,7 @@ namespace vISA
14321432
_CompactSourceTable3Src_ CompactSourceTable3Src;
14331433
_CompactSourceTable3SrcCHV_ CompactSourceTable3SrcCHV;
14341434

1435-
BinaryEncodingBase(Mem_Manager &m, G4_Kernel& k, std::string fname)
1435+
BinaryEncodingBase(Mem_Manager &m, G4_Kernel& k, std::string fname)
14361436
: BDWCompactControlTable(m),
14371437
BDWCompactSourceTable(m),
14381438
BDWCompactSubRegTable(m),

0 commit comments

Comments
 (0)