@@ -909,11 +909,11 @@ static std::string printInstructionCommon(
909
909
static std::string printInstructionControlFlow (
910
910
const print_format_provider_t * header,
911
911
const CISA_INST* inst,
912
- const Options * opt)
912
+ const Options* opt)
913
913
{
914
914
ISA_Opcode opcode = (ISA_Opcode)inst->opcode ;
915
915
unsigned i = 0 ;
916
- uint16_t label_id = 0 ;
916
+ uint16_t label_id = 0 ;
917
917
918
918
std::stringstream sstr;
919
919
@@ -965,11 +965,14 @@ static std::string printInstructionControlFlow(
965
965
}
966
966
else
967
967
{
968
- sstr << printPredicate (inst->opcode , inst->pred )
969
- << ISA_Inst_Table[opcode].str
970
- << " "
971
- << printExecutionSize (inst->opcode , inst->execsize );
972
-
968
+ auto printInstName = [](std::stringstream& SS, const CISA_INST* I, const char * IName) {
969
+ SS << printPredicate (I->opcode , I->pred )
970
+ << ISA_Inst_Table[I->opcode ].str
971
+ << " "
972
+ << printExecutionSize (I->opcode , I->execsize );
973
+ };
974
+
975
+ const char * InstName = ISA_Inst_Table[opcode].str ;
973
976
switch (opcode)
974
977
{
975
978
case ISA_JMP:
@@ -980,6 +983,13 @@ static std::string printInstructionControlFlow(
980
983
// / label / function id to jump / call to.
981
984
label_id = getPrimitiveOperand<uint16_t >(inst, i++);
982
985
986
+ // If it is fccall, using "fccall" as text name.
987
+ bool is_fccall = false ; // (opcode == ISA_CALL && header->getLabel(label_id)->kind == LABEL_FC);
988
+ InstName = is_fccall ? " fccall" : InstName;
989
+
990
+ // print instruction name, etc
991
+ printInstName (sstr, inst, InstName);
992
+
983
993
if (opcode == ISA_FCALL)
984
994
{
985
995
// / function name in string
@@ -1005,6 +1015,9 @@ static std::string printInstructionControlFlow(
1005
1015
}
1006
1016
case ISA_IFCALL:
1007
1017
{
1018
+ // print instruction name, etc
1019
+ printInstName (sstr, inst, InstName);
1020
+
1008
1021
sstr << printOperand (header, inst, i++, opt);
1009
1022
// / arg size
1010
1023
sstr << " " << getPrimitiveOperand<unsigned >(inst, i++);
@@ -1014,6 +1027,9 @@ static std::string printInstructionControlFlow(
1014
1027
}
1015
1028
case ISA_FADDR:
1016
1029
{
1030
+ // print instruction name, etc
1031
+ printInstName (sstr, inst, InstName);
1032
+
1017
1033
// / symbol name in string
1018
1034
sstr << header->getString (getPrimitiveOperand<uint16_t >(inst, i++));
1019
1035
// / dst
@@ -1022,6 +1038,9 @@ static std::string printInstructionControlFlow(
1022
1038
}
1023
1039
case ISA_SWITCHJMP:
1024
1040
{
1041
+ // print instruction name, etc
1042
+ printInstName (sstr, inst, InstName);
1043
+
1025
1044
// / skip num_labels
1026
1045
i++;
1027
1046
// / index
0 commit comments