Skip to content

Commit

Permalink
Fix absolute address calculations.
Browse files Browse the repository at this point in the history
Absolute effective addresses are calculated decoded by DecodeBInstruction().
Because they are encoded as normal disp24 value.
To form the EA:
The lower 20bits are shifted by one, and the upper 4bits by 1 (jumps) or 7 (calls).
  • Loading branch information
Rot127 committed Oct 9, 2024
1 parent 981d648 commit 0dc6d70
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/TriCore/TriCoreInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ static void printDisp24Imm(MCInst *MI, int OpNum, SStream *O)
case TRICORE_JA_b:
case TRICORE_JLA_b:
// = {disp24[23:20], 7’b0000000, disp24[19:0], 1’b0};
res = ((wrapping_u32(disp) & 0xf00000ULL) << 28) |
((wrapping_u32(disp) & 0xfffffULL) << 1);
res = disp << 1;
break;
case TRICORE_J_b:
case TRICORE_JL_b:
Expand Down

0 comments on commit 0dc6d70

Please sign in to comment.