diff options
author | Mike Leach <mike.leach@linaro.org> | 2021-10-09 16:02:56 +0100 |
---|---|---|
committer | Mike Leach <mike.leach@linaro.org> | 2022-03-10 14:43:49 +0000 |
commit | 99a3a0f678114c973203e71ef9dbf64e297b9070 (patch) | |
tree | f7df90a98d094041b8ca8624e18a3ddc4a5d3c8d | |
parent | 18faf6ae040541c5e301a712f12bb92542fccf82 (diff) | |
download | OpenCSD-99a3a0f678114c973203e71ef9dbf64e297b9070.tar.gz |
opencsd: Update for BC.cond instruction in arch 8.8 and 9.3
Instruction analyser adjusted to recognise the new BC <cond> instruction as
a direct branch which is associated with atom elements.
Signed-off-by: Mike Leach <mike.leach@linaro.org>
-rw-r--r-- | decoder/source/i_dec/trc_idec_arminst.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/decoder/source/i_dec/trc_idec_arminst.cpp b/decoder/source/i_dec/trc_idec_arminst.cpp index 58450ee..76951fd 100644 --- a/decoder/source/i_dec/trc_idec_arminst.cpp +++ b/decoder/source/i_dec/trc_idec_arminst.cpp @@ -244,8 +244,9 @@ int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link, struct decod int is_direct_branch = 1; if ((inst & 0x7c000000) == 0x34000000) { /* CB, TB */ - } else if ((inst & 0xff000010) == 0x54000000) { + } else if ((inst & 0xff000000) == 0x54000000) { /* B<cond> */ + /* BC<cond> 8.8 / 9.3 arch - bit 4 = 1'b1 */ } else if ((inst & 0x7c000000) == 0x14000000) { /* B, BL imm */ if (inst & 0x80000000) { @@ -414,8 +415,9 @@ int inst_A64_branch_destination(uint64_t addr, uint32_t inst, uint64_t *pnpc) { uint64_t npc; int is_direct_branch = 1; - if ((inst & 0xff000010) == 0x54000000) { + if ((inst & 0xff000000) == 0x54000000) { /* B<cond> */ + /* BC<cond> */ npc = addr + ((int32_t)((inst & 0x00ffffe0) << 8) >> 11); } else if ((inst & 0x7c000000) == 0x14000000) { /* B, BL imm */ @@ -568,8 +570,9 @@ int inst_A64_is_conditional(uint32_t inst) if ((inst & 0x7c000000) == 0x34000000) { /* CB, TB */ return 1; - } else if ((inst & 0xff000010) == 0x54000000) { + } else if ((inst & 0xff000000) == 0x54000000) { /* B.cond */ + /* BC.cond */ return 1; } return 0; |