[Mips] Fix evaluating J-format branch targets
authorSimon Atanasyan <simon@atanasyan.com>
Mon, 7 Oct 2019 14:01:22 +0000 (14:01 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Mon, 7 Oct 2019 14:01:22 +0000 (14:01 +0000)
commit19ede2f53b78472c3bc3536f00609d22253a7d52
treed8b49c215384d74e559c3a39680b29b8fd634132
parent8dc1700979bc630e6bd8b0912cfc034814e67c7f
[Mips] Fix evaluating J-format branch targets

J/JAL/JALX/JALS are absolute branches, but stay within the current
256 MB-aligned region, so we must include the high bits of the
instruction address when calculating the branch target.

Patch by James Clarke.

Differential Revision: https://reviews.llvm.org/D68548

llvm-svn: 373906
llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
llvm/test/MC/Mips/micromips-jump-pc-region.s [new file with mode: 0644]
llvm/test/MC/Mips/mips-jump-pc-region.s [new file with mode: 0644]