Skip to content

Commit 7a267e7

Browse files
trbauerigcbot
authored andcommitted
refactor for internal
refactor for internal feature
1 parent 85dd264 commit 7a267e7

File tree

9 files changed

+53
-21
lines changed

9 files changed

+53
-21
lines changed

visa/BuildCISAIR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ class CISA_IR_Builder : public VISABuilder {
489489
VISA_opnd *exMsgDesc, unsigned char ffid, unsigned char src0Size,
490490
unsigned char src1Size, unsigned char dstSize, VISA_opnd *Desc,
491491
VISA_opnd *src0, VISA_opnd *src1, VISA_opnd *dst, int lineNum);
492+
492493
bool CISA_create_fence_instruction(ISA_Opcode opcode, unsigned char mode,
493494
int lineNum);
494495
bool CISA_create_wait_instruction(VISA_opnd *mask, int lineNum);

visa/BuildCISAIRImpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,6 +3456,7 @@ bool CISA_IR_Builder::CISA_create_raw_sends_instruction(
34563456

34573457
return true;
34583458
}
3459+
34593460
/*
34603461
Should be only called from CISA 2.4+
34613462
*/

visa/CISA.y

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void CISAerror(CISA_IR_Builder* builder, char const* msg);
3131
int yylex(CISA_IR_Builder *pBuilder);
3232
extern int CISAlineno;
3333

34-
34+
static bool streq(const char *sym0, const char *sym1);
3535
static bool ParseAlign(CISA_IR_Builder* pBuilder, const char *sym, VISA_Align &value);
3636
static VISA_Align AlignBytesToVisaAlignment(int bytes);
3737
static int DataTypeSizeOf(VISA_Type type);
@@ -290,12 +290,16 @@ std::vector<attr_gen_struct*> AttrOptVar;
290290
%token CPS // .cps
291291
%token NON_UNIFORM_SAMPLER // .divS
292292
%token PIXEL_NULL_MASK // .pixel_null_mask
293+
294+
%token RAW_SEND_STRING // raw_send
293295
%token RAW_SENDC_STRING // raw_sendc
294-
%token RAW_SENDSC_EOT_STRING // raw_sendsc_eot
295-
%token RAW_SENDSC_STRING // raw_sendsc
296-
%token RAW_SENDS_EOT_STRING // raw_sends_eot
296+
297297
%token RAW_SENDS_STRING // raw_sends
298-
%token RAW_SEND_STRING // raw_send
298+
%token RAW_SENDS_EOT_STRING // raw_sends_eot
299+
%token RAW_SENDSC_STRING // raw_sendsc
300+
%token RAW_SENDSC_EOT_STRING // raw_sendsc_eot
301+
302+
299303
%token SAT // .sat
300304
%token SRCMOD_ABS // (abs)
301305
%token SRCMOD_NEG // (-)
@@ -2260,6 +2264,7 @@ RawSendsInstruction:
22602264
$8.cisa_gen_opnd, $9, $10, $11, CISAlineno);
22612265
}
22622266

2267+
22632268
NullaryInstruction:
22642269
CACHE_FLUSH_OP
22652270
{
@@ -2836,6 +2841,8 @@ IntExpRel:
28362841
| IntExpNRA GEQ IntExpNRA {$$ = $1 >= $3;}
28372842
| IntExpNRA
28382843

2844+
// IntExpNRA - "integer expression no right angle"
2845+
//
28392846
// In all cases where RANGLE follows an int expression we must start
28402847
// expression parsing at a higher precedence than relational operators
28412848
//
@@ -2930,6 +2937,11 @@ void CISAerror(CISA_IR_Builder* pBuilder, char const *s)
29302937
pBuilder->RecordParseError(CISAlineno, s);
29312938
}
29322939

2940+
static bool streq(const char *sym0, const char *sym1)
2941+
{
2942+
return strcmp(sym0, sym1) == 0;
2943+
}
2944+
29332945
static bool ParseAlign(CISA_IR_Builder* pBuilder, const char *sym, VISA_Align &value)
29342946
{
29352947
if (strcmp(sym, "byte") == 0) {

visa/G4Instruction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ HANDLE_INST(pseudo_sada2, 3, 1, InstTypeVector, GENX_BDW, ATTR_NONE)
165165
// InstTypeMisc
166166
//
167167
HANDLE_INST(wait, 1, 0, InstTypeMisc, GENX_BDW, ATTR_NONE)
168+
168169
HANDLE_INST(send, 2, 1, InstTypeMisc, GENX_BDW, ATTR_NONE)
169170
HANDLE_INST(sendc, 2, 1, InstTypeMisc, GENX_BDW, ATTR_NONE)
170171
HANDLE_INST(sends, 4, 1, InstTypeMisc, GENX_SKL, ATTR_NONE)
171172
HANDLE_INST(sendsc, 4, 1, InstTypeMisc, GENX_SKL, ATTR_NONE)
173+
172174
HANDLE_INST(nop, 0, 0, InstTypeMisc, GENX_BDW, ATTR_NONE)
173175

174176
HANDLE_INST(sync_nop, 1, 0, InstTypeMisc, GENX_TGLLP, ATTR_NONE)

visa/IsaDescription.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ struct ISA_Inst_Info ISA_Inst_Table[ISA_OPCODE_ENUM_SIZE] = {
167167
{ISA_RESERVED_8F, ISA_Inst_Reserved, "reserved8f", 0, 0},
168168
{ISA_RESERVED_90, ISA_Inst_Reserved, "reserved90", 0, 0},
169169
{ISA_MADW, ISA_Inst_Arith, "madw", 3, 1},
170-
{ISA_ADD3O, ISA_Inst_Arith, "add3.o", 3, 1}};
170+
{ISA_ADD3O, ISA_Inst_Arith, "add3.o", 3, 1},
171+
{ISA_RESERVED_93, ISA_Inst_Reserved, "reserved93", 0, 0},
172+
};
171173

172174
VISA_INST_Desc CISA_INST_table[ISA_NUM_OPCODE] = {
173175
/// 0
@@ -2680,6 +2682,16 @@ VISA_INST_Desc CISA_INST_table[ISA_NUM_OPCODE] = {
26802682
ISA_TYPE_W | ISA_TYPE_UW | ISA_TYPE_D | ISA_TYPE_UD, 0},
26812683
},
26822684
},
2685+
/// 147 (0x93)
2686+
{
2687+
ALL,
2688+
ISA_RESERVED_93,
2689+
ISA_Inst_Reserved,
2690+
"reserved_93",
2691+
0,
2692+
0,
2693+
{},
2694+
},
26832695
};
26842696

26852697
static const ISA_SubInst_Desc VASubOpcodeDesc[] = {

visa/VISAKernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class VISAKernelImpl : public VISAFunction {
215215

216216
void setGenxDebugInfoBuffer(char *buffer, unsigned long size);
217217
VISA_opnd *CreateOtherOpndHelper(int num_pred_desc_operands, int num_operands,
218-
VISA_INST_Desc *inst_desc,
218+
const VISA_INST_Desc *inst_desc,
219219
unsigned int value,
220220
bool hasSubOpcode = false,
221221
uint8_t subOpcode = 0);

visa/VISAKernelImpl.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void ADD_OPND(int &num_operands, VISA_opnd **opnd, VISA_opnd *topnd) {
6161
}
6262
}
6363

64-
static int CHECK_NUM_OPNDS(VISA_INST_Desc *instDesc, int numOperands,
64+
static int CHECK_NUM_OPNDS(const VISA_INST_Desc *instDesc, int numOperands,
6565
int predOpnds) {
6666

6767
if ((instDesc->opnd_num - predOpnds) != numOperands) {
@@ -72,7 +72,7 @@ static int CHECK_NUM_OPNDS(VISA_INST_Desc *instDesc, int numOperands,
7272
return VISA_SUCCESS;
7373
}
7474
static void GET_NUM_PRED_DESC_OPNDS(int &predOpnd,
75-
VISA_INST_Desc *inst_desc_temp) {
75+
const VISA_INST_Desc *inst_desc_temp) {
7676
predOpnd = 0;
7777
for (int i = 0; i < inst_desc_temp->opnd_num; i++) {
7878
if (inst_desc_temp->opnd_desc[i].opnd_type == OPND_EXECSIZE ||
@@ -2144,7 +2144,6 @@ int VISAKernelImpl::CreateVISADstOperand(VISA_VectorOpnd *&cisa_opnd,
21442144
}
21452145

21462146
if (IS_VISA_BOTH_PATH) {
2147-
21482147
cisa_opnd->opnd_type = CISA_OPND_VECTOR;
21492148
cisa_opnd->tag =
21502149
OPERAND_GENERAL; //<--- I think this is redundant at this point.
@@ -4759,11 +4758,12 @@ int VISAKernelImpl::AppendVISAMiscRawSend(
47594758
}
47604759

47614760
int VISAKernelImpl::AppendVISAMiscRawSends(
4762-
VISA_PredOpnd *pred, VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize,
4763-
unsigned char modifiers, unsigned ffid, VISA_VectorOpnd *exMsgDesc,
4764-
unsigned char src0Size, unsigned char src1Size, unsigned char dstSize,
4765-
VISA_VectorOpnd *desc, VISA_RawOpnd *src0, VISA_RawOpnd *src1,
4766-
VISA_RawOpnd *dst, bool hasEOT) {
4761+
VISA_PredOpnd *pred, VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize,
4762+
unsigned char modifiers, unsigned ffid, VISA_VectorOpnd *exMsgDesc,
4763+
unsigned char src0Size, unsigned char src1Size, unsigned char dstSize,
4764+
VISA_VectorOpnd *desc, VISA_RawOpnd *src0, VISA_RawOpnd *src1,
4765+
VISA_RawOpnd *dst, bool hasEOT)
4766+
{
47674767
TIME_SCOPE(VISA_BUILDER_APPEND_INST);
47684768

47694769
AppendVISAInstCommon();
@@ -8671,7 +8671,7 @@ VISA_opnd *VISAKernelImpl::CreateOtherOpnd(unsigned int value,
86718671

86728672
// FIXME: this needs major rework
86738673
VISA_opnd *VISAKernelImpl::CreateOtherOpndHelper(
8674-
int num_pred_desc_operands, int num_operands, VISA_INST_Desc *inst_desc,
8674+
int num_pred_desc_operands, int num_operands, const VISA_INST_Desc *inst_desc,
86758675
unsigned int value, bool hasSubOpcode, uint8_t subOpcode) {
86768676
VISA_Type dataType = ISA_TYPE_NUM;
86778677
VISA_opnd *temp = getOpndFromPool();
@@ -8717,6 +8717,7 @@ G4_Operand *VISAKernelImpl::CommonISABuildPreDefinedSrc(
87178717
G4_Operand *tmpsrc = NULL;
87188718
PreDefinedVarsInternal internalIndex = mapExternalToInternalPreDefVar(index);
87198719
switch (internalIndex) {
8720+
case PreDefinedVarsInternal::VAR_NULL:
87208721
case PreDefinedVarsInternal::X:
87218722
case PreDefinedVarsInternal::Y:
87228723
case PreDefinedVarsInternal::LOCAL_ID_X:

visa/VisaToG4/TranslateSendRaw.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,14 @@ int IR_Builder::translateVISARawSendsInst(
129129
msgDescOpnd, inst_opt, sendMsgDesc, temp_exdesc_src,
130130
true);
131131
if (getOption(vISA_renderTargetWriteSendReloc) &&
132-
dstOpnd->isNullReg() &&
133-
SFID::DP_RC == intToSFID(ffid, getPlatform())) {
134-
std::string symbolName{ "RTW_SEND" };
135-
RelocationEntry::createRelocation(kernel, *sendInst, 0, symbolName,
136-
GenRelocType::R_SEND);
132+
dstOpnd->isNullReg() &&
133+
SFID::DP_RC == intToSFID(ffid, getPlatform()))
134+
{
135+
std::string symbolName{ "RTW_SEND" };
136+
RelocationEntry::createRelocation(kernel, *sendInst, 0, symbolName,
137+
GenRelocType::R_SEND);
137138
}
138139

139140
return VISA_SUCCESS;
140141
}
142+

visa/include/visa_igc_common_header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ typedef enum {
405405
ISA_RESERVED_90 = 0x90,
406406
ISA_MADW = 0x91,
407407
ISA_ADD3O = 0x92,
408+
ISA_RESERVED_93 = 0x93,
408409
ISA_NUM_OPCODE,
409410
ISA_OPCODE_ENUM_SIZE = 0xFF
410411
} ISA_Opcode;

0 commit comments

Comments
 (0)