This patch fixes the inaccurate decoding of the offset operand of
the conditional branch instructions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
We can not test this in llvm/test/MC/AVR/, since the llvm-objdump decodes all addresses/offsets (before linking) to zeros. We have to test them in lld/test/ELF/.
llvm/test/MC/AVR/inst-brbc.s | ||
---|---|---|
19 | The llvm-objdump's option --no-aliases has not been implemented on AVR. So we can not decoded to their original forms. |
The conditional branch instructions are defined in two ways:
- Defined as stand alone instructions: such as breq, brne, brlo, ...
- Defined as aliases of brbc/brbs, such brbs, brbc, brid, brie, ...
The above two situations are both tested in current patch.
ping ...
This patch block another patch (https://reviews.llvm.org/D141197) which has already been approved. If this one can be accepted, all known dissassembler bugs should be fixed.
llvm/lib/Target/AVR/Disassembler/AVRDisassembler.cpp | ||
---|---|---|
300 | A pair array will be more efficient with so few values. You can use llvm::partition_point to do bisection. |
llvm/lib/Target/AVR/Disassembler/AVRDisassembler.cpp | ||
---|---|---|
300 | Thanks. I will change to llvm::partition_point when commiting. |
A pair array will be more efficient with so few values. You can use llvm::partition_point to do bisection.