This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix disassembler offset for compact branches
AbandonedPublic

Authored by sdardis on May 23 2016, 5:31 AM.

Details

Summary

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.

Diff Detail

Event Timeline

sdardis updated this revision to Diff 58085.May 23 2016, 5:31 AM
sdardis retitled this revision from to [mips] Fix disassembler offset for compact branches.
sdardis updated this object.
sdardis added reviewers: dsanders, vkalintiris.
sdardis set the repository for this revision to rL LLVM.
sdardis added a subscriber: llvm-commits.
sdardis abandoned this revision.May 24 2016, 4:42 AM

Patch already submitted for this issue.