[PATCH] D20520: [mips] Fix disassembler offset for compact branches

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 05:31:45 PDT 2016


sdardis created this revision.
sdardis added reviewers: dsanders, vkalintiris.
sdardis added a subscriber: llvm-commits.
sdardis set the repository for this revision to rL LLVM.
Herald added subscribers: sdardis, dsanders.

As the MIPSR6 specification says, a 18/23-bit signed offset (the 16/21-bit
offset field shifted left 2 bits) is added to the address of the instruction
following the (compact) branch (not the branch itself), to form a PC-relative
effective target address.

Similarly for branches which take a 26bit offset

The immediate for those branches is only shifted when it should be shifted
and added.

Repository:
  rL LLVM

http://reviews.llvm.org/D20520

Files:
  lib/Target/Mips/Disassembler/MipsDisassembler.cpp
  test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s
  test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
  test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt
  test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt
  test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt
  test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20520.58085.patch
Type: text/x-patch
Size: 19607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160523/e9660857/attachment.bin>


More information about the llvm-commits mailing list