DBNZ instruction is in BRANCH class as other branch instructons like B, Bcc, etc. However, DBNZ is the only one branch instruction
that stores a branch offset not in the first operand but in the second one.
However, current logic of arc_insn_get_branch_target assumes that a branch offset is always stored in the first operand for BRANCH class. Thus, it's necessary to add extra logic for determining DBNZ and getting a correct offset.
DBNZ instruction is in BRANCH class as other branch instructons like B, Bcc, etc. However, DBNZ is the only one branch instruction that stores a branch offset not in the first operand but in the second one.
However, current logic of arc_insn_get_branch_target assumes that a branch offset is always stored in the first operand for BRANCH class. Thus, it's necessary to add extra logic for determining DBNZ and getting a correct offset.
This PR resolves this issue: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/546