Skip to content

Commit

Permalink
tricore: fixes #2386 in v5 (#2527)
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow authored Nov 1, 2024
1 parent 36a9619 commit 8455b3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/TriCore/TriCoreInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ static void printDisp4Imm(MCInst *MI, int OpNum, SStream *O)
case TRICORE_LOOP_sbr:
// {27b’111111111111111111111111111, disp4, 0};
disp = (int32_t)MI->address +
((0x7ffffff << 5) |
(disp << 1));
((0x7ffffff << 5) | (disp << 1));
break;
default:
// handle other cases, if any
Expand Down Expand Up @@ -449,10 +448,11 @@ static void printOExtImm_4(MCInst *MI, int OpNum, SStream *O)
if (MCOperand_isImm(MO)) {
uint32_t imm = MCOperand_getImm(MO);
// {27b’111111111111111111111111111, disp4, 0};
imm = 0xffffffe0 | (imm << 1);
int32_t off = (int32_t)(0xffffffe0 | (imm << 1));
uint32_t target = (int32_t)MI->address + off;

printInt32Bang(O, imm);
fill_imm(MI, imm);
printUInt32(O, target);
fill_imm(MI, (int32_t)target);
} else
printOperand(MI, OpNum, O);
}
Expand Down
1 change: 1 addition & 0 deletions suite/MC/TriCore/handwrite.s.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# CS_ARCH_TRICORE, CS_MODE_TRICORE_162, None
0x8f,0xff,0x83,0x81 = xor d8, d15, #0x3f
0xfc,0x2e = loop a2, 0xfffffffc

0 comments on commit 8455b3c

Please sign in to comment.