Skip to content

Commit eafef59

Browse files
anikaushikigcbot
authored andcommitted
Minor refactor around rt write operations
Minor refactor around RT write operations (NFC)
1 parent 3419137 commit eafef59

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

visa/BuildCISAIRImpl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,10 +3270,12 @@ bool CISA_IR_Builder::CISA_create_rtwrite_3d_instruction(
32703270
A = operands[counter++];
32713271
}
32723272

3273-
VISA_StateOpndHandle *surface =
3274-
CISA_get_surface_variable(surfaceName, lineNum);
3275-
if (!surface)
3276-
return false; // error recorded
3273+
VISA_StateOpndHandle* surface = nullptr;
3274+
if (surfaceName != nullptr) {
3275+
surface = CISA_get_surface_variable(surfaceName, lineNum);
3276+
if (!surface)
3277+
return false; // error recorded
3278+
}
32773279

32783280
uint8_t numMsgSpecificOpnd = 0;
32793281
VISA_RawOpnd *rawOpnds[20];

visa/CISA.y

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,11 +1419,10 @@ RTWriteOperands:
14191419
RTRWOperandsVec.push_back($2);
14201420
}
14211421

1422-
RTWriteInstruction: RTWInstruction
1423-
1424-
// 1 2 3 4 5 6
1425-
RTWInstruction: Predicate RTWRITE_OP_3D RTWriteModeOpt ExecSize Var
1426-
RTWriteOperands
1422+
// 1 2 3 4 5
1423+
RTWriteInstruction: Predicate RTWRITE_OP_3D RTWriteModeOpt ExecSize Var
1424+
// 6
1425+
RTWriteOperands
14271426
{
14281427
bool result = pBuilder->CISA_create_rtwrite_3d_instruction(
14291428
$1, $3, $4.emask, (unsigned int)$4.exec_size, $5,

visa/IsaDescription.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct ISA_Inst_Info ISA_Inst_Table[ISA_OPCODE_ENUM_SIZE] = {
134134
{ISA_3D_LOAD, ISA_Inst_Sampler, "load_3d", 5, 1},
135135
{ISA_3D_GATHER4, ISA_Inst_Sampler, "gather4_3d", 5, 1},
136136
{ISA_3D_INFO, ISA_Inst_Sampler, "info_3d", 2, 1},
137-
{ISA_3D_RT_WRITE, ISA_Inst_Data_Port, "rt_write_3d", 3, 0},
137+
{ISA_3D_RT_WRITE, ISA_Inst_Data_Port, "rt_write_3d", 3, 1},
138138
{ISA_3D_URB_WRITE, ISA_Inst_Misc, "urb_write_3d", 6, 0},
139139
{ISA_3D_TYPED_ATOMIC, ISA_Inst_Data_Port, "typed_atomic", 9, 1},
140140
{ISA_GATHER4_SCALED, ISA_Inst_Data_Port, "gather4_scaled", 4, 1},
@@ -2110,7 +2110,7 @@ VISA_INST_Desc CISA_INST_table[ISA_NUM_OPCODE] = {
21102110
{OPND_EXECSIZE, ISA_TYPE_UB, SIZE_1},
21112111
{OPND_PRED, ISA_TYPE_UW, 0}, /// predicate
21122112
{OPND_OTHER, ISA_TYPE_UW, 0}, /// mode
2113-
{OPND_SURFACE, ISA_TYPE_UB, 0}, /// Surface
2113+
{OPND_SURFACE | OPND_SRC_GEN | OPND_IMM | OPND_SRC_ADDR, ISA_TYPE_UB | ISA_TYPE_Q | ISA_TYPE_UQ, 0}, /// Surface
21142114
},
21152115

21162116
},

visa/IsaDisassembly.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,10 +2362,11 @@ printInstructionDataport(const print_format_provider_t *header,
23622362
}
23632363

23642364
sstr << " " << printExecutionSize(inst->opcode, inst->execsize);
2365-
2366-
// surface
2367-
surface = getPrimitiveOperand<uint8_t>(inst, i++);
2368-
sstr << " " << printSurfaceName(surface);
2365+
{
2366+
// surface
2367+
surface = getPrimitiveOperand<uint8_t>(inst, i++);
2368+
sstr << " " << printSurfaceName(surface);
2369+
}
23692370

23702371
while (i < inst->opnd_num) {
23712372
sstr << printOperand(header, inst, i++, opt);

0 commit comments

Comments
 (0)