Skip to content

Commit

Permalink
Fix tricore disp print
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed May 12, 2023
1 parent 460d119 commit b02d471
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/TriCore/TriCoreInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void printDisp15Imm(MCInst *MI, int OpNum, SStream *O)
{
MCOperand *MO = MCInst_getOperand(MI, OpNum);
if (MCOperand_isImm(MO)) {
int32_t disp = (int32_t)MCOperand_getImm(MO);
uint32_t disp = (int32_t)MCOperand_getImm(MO);
switch (MCInst_getOpcode(MI)) {
case TRICORE_JEQ_brc:
case TRICORE_JEQ_brr:
Expand Down Expand Up @@ -391,7 +391,7 @@ static void printDisp15Imm(MCInst *MI, int OpNum, SStream *O)
break;
}

SS_print_sign_hex(O, disp);
SS_print_hex(O, disp);
fixup_tricore_disp(MI, OpNum, disp);
} else
printOperand(MI, OpNum, O);
Expand All @@ -401,7 +401,7 @@ static void printDisp8Imm(MCInst *MI, int OpNum, SStream *O)
{
MCOperand *MO = MCInst_getOperand(MI, OpNum);
if (MCOperand_isImm(MO)) {
int32_t disp = (int32_t)MCOperand_getImm(MO);
uint32_t disp = (int32_t)MCOperand_getImm(MO);
switch (MCInst_getOpcode(MI)) {
case TRICORE_CALL_sb:
disp = (int32_t)MI->address + sign_ext_n(2 * disp, 8);
Expand All @@ -416,7 +416,7 @@ static void printDisp8Imm(MCInst *MI, int OpNum, SStream *O)
break;
}

SS_print_sign_hex(O, disp);
SS_print_hex(O, disp);
fixup_tricore_disp(MI, OpNum, disp);
} else
printOperand(MI, OpNum, O);
Expand All @@ -426,7 +426,7 @@ static void printDisp4Imm(MCInst *MI, int OpNum, SStream *O)
{
MCOperand *MO = MCInst_getOperand(MI, OpNum);
if (MCOperand_isImm(MO)) {
int32_t disp = (int32_t)MCOperand_getImm(MO);
uint32_t disp = (int32_t)MCOperand_getImm(MO);
switch (MCInst_getOpcode(MI)) {
case TRICORE_JEQ_sbc1:
case TRICORE_JEQ_sbr1:
Expand Down Expand Up @@ -461,7 +461,7 @@ static void printDisp4Imm(MCInst *MI, int OpNum, SStream *O)
break;
}

SS_print_sign_hex(O, disp);
SS_print_hex(O, disp);
fixup_tricore_disp(MI, OpNum, disp);
} else
printOperand(MI, OpNum, O);
Expand Down

0 comments on commit b02d471

Please sign in to comment.