Skip to content

Commit 280b5e0

Browse files
jgu222igcbot
authored andcommitted
internal minor change
Internal change
1 parent b5da667 commit 280b5e0

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

visa/BuildCISAIR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class CISA_IR_Builder : public VISABuilder
269269
VISA_EMask_Ctrl emask,
270270
unsigned exec_size,
271271
const char *target_label,
272+
bool is_fccall,
272273
int lineNum);
273274

274275

visa/BuildCISAIRImpl.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,7 @@ bool CISA_IR_Builder::CISA_create_branch_instruction(
18291829
VISA_EMask_Ctrl emask,
18301830
unsigned exec_size,
18311831
const char *target_label,
1832+
bool is_fccall,
18321833
int lineNum)
18331834
{
18341835
VISA_LabelOpnd * opnd[1];
@@ -1842,10 +1843,12 @@ bool CISA_IR_Builder::CISA_create_branch_instruction(
18421843
//determine correct IDs since function directive might not have been
18431844
//encountered yet
18441845
opnd[i] = m_kernel->getLabelOperandFromFunctionName(std::string(target_label));
1846+
1847+
VISA_Label_Kind lblKind = is_fccall ? LABEL_FC : LABEL_SUBROUTINE;
18451848
if (!opnd[i])
18461849
{
1847-
VISA_CALL_TO_BOOL(CreateVISALabelVar, opnd[i], target_label, LABEL_SUBROUTINE);
1848-
opnd[i]->tag = ISA_SUBROUTINE;
1850+
VISA_CALL_TO_BOOL(CreateVISALabelVar, opnd[i], target_label, lblKind);
1851+
opnd[i]->tag = lblKind;
18491852
}
18501853
VISA_Exec_Size executionSize = Get_VISA_Exec_Size_From_Raw_Size(exec_size);
18511854
VISA_CALL_TO_BOOL(AppendVISACFCallInst,

visa/CISA.l

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ vme_fbr {
521521
return VME_FBR_OP;
522522
}
523523

524-
jmp|call|goto {
524+
jmp|goto {
525525
TRACE("** branch INST");
526526
CISAlval.opcode = str2opcode(yytext);
527527
return BRANCH_OP;
@@ -533,6 +533,20 @@ ret|fret {
533533
return RET_OP;
534534
}
535535

536+
call {
537+
TRACE("** call INST");
538+
CISAlval.cisa_call.opcode = ISA_CALL;
539+
CISAlval.cisa_call.is_fccall = false;
540+
return CALL_OP;
541+
}
542+
543+
fccall {
544+
TRACE("** fccall INST");
545+
CISAlval.cisa_call.opcode = ISA_CALL;
546+
CISAlval.cisa_call.is_fccall = true;
547+
return CALL_OP;
548+
}
549+
536550
fcall {
537551
TRACE("** function call INST");
538552
CISAlval.opcode = ISA_FCALL;

visa/CISA.y

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ std::vector<attr_gen_struct*> AttrOptVar;
105105
VISA_PREDICATE_STATE pred_sign;
106106
VISA_PREDICATE_CONTROL pred_ctrl;
107107

108+
// to tell call is fc_call or subroutine call
109+
struct call_sub_or_fc {
110+
ISA_Opcode opcode;
111+
bool is_fccall;
112+
} cisa_call;
113+
108114
struct {
109115
VISA_Modifier mod;
110116
} src_mod;
@@ -384,6 +390,7 @@ std::vector<attr_gen_struct*> AttrOptVar;
384390
%token <opcode> LIFETIME_START_OP
385391
%token <opcode> LIFETIME_END_OP
386392
%token <opcode> AVS_OP
393+
%token <cisa_call> CALL_OP
387394

388395
%type <string> RTWriteModeOpt
389396

@@ -1383,7 +1390,11 @@ SwitchLabels:
13831390
// 1 2 3 4
13841391
BranchInstruction: Predicate BRANCH_OP ExecSize IdentOrStringLit
13851392
{
1386-
pBuilder->CISA_create_branch_instruction($1, $2, $3.emask, $3.exec_size, $4, CISAlineno);
1393+
pBuilder->CISA_create_branch_instruction($1, $2, $3.emask, $3.exec_size, $4, false, CISAlineno);
1394+
}
1395+
| Predicate CALL_OP ExecSize IdentOrStringLit
1396+
{
1397+
pBuilder->CISA_create_branch_instruction($1, $2.opcode, $3.emask, $3.exec_size, $4, $2.is_fccall, CISAlineno);
13871398
}
13881399
| Predicate RET_OP ExecSize
13891400
{

visa/IsaDisassembly.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ static std::string printInstructionControlFlow(
969969
label_id = getPrimitiveOperand<uint16_t>(inst, i++);
970970

971971
const label_info_t* lblinfo = header->getLabel(label_id);
972-
const char* instName = ((false && lblinfo->kind == LABEL_FC) ? "fccall" : ISA_Inst_Table[opcode].str);
972+
const char* instName = (lblinfo->kind == LABEL_FC ? "fccall" : ISA_Inst_Table[opcode].str);
973973
sstr << printPredicate(opcode, inst->pred)
974974
<< instName
975975
<< " "
@@ -2713,4 +2713,4 @@ std::string printInstruction(
27132713
}
27142714

27152715
return sstr.str();
2716-
}
2716+
}

visa/IsaVerification.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,11 @@ void vISAVerifier::finalize()
31223122
{
31233123
if (!(iter.second))
31243124
{
3125-
REPORT_HEADER(options, false, "undefined label: %s", header->getString(header->getLabel(iter.first)->name_index));
3125+
const label_info_t* lblInfo = header->getLabel(iter.first);
3126+
if (lblInfo->kind != LABEL_FC)
3127+
{
3128+
REPORT_HEADER(options, false, "undefined label: %s", header->getString(lblInfo->name_index));
3129+
}
31263130
}
31273131
}
31283132
}

0 commit comments

Comments
 (0)