diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2016-08-31 11:47:17 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2016-08-31 11:47:17 +0000 |
commit | 97519cba2e664b0b15eaa7202ba2dd7d2a2c9c4e (patch) | |
tree | 3051bb8b26cbd69e798ce4ae7919be05f545ab56 | |
parent | eba808957e15290e4ade5d3a80c31c0e36bdd7bd (diff) | |
download | bcm5719-llvm-97519cba2e664b0b15eaa7202ba2dd7d2a2c9c4e.tar.gz bcm5719-llvm-97519cba2e664b0b15eaa7202ba2dd7d2a2c9c4e.zip |
[ELF][MIPS] Inline function. NFC
llvm-svn: 280222
-rw-r--r-- | lld/ELF/Target.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 32f03f422f4..f18789af940 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1942,8 +1942,6 @@ void MipsTargetInfo<ELFT>::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { write32<ELFT::TargetEndianness>(Buf, Out<ELFT>::Plt->getVA()); } -static uint16_t mipsHigh(uint64_t V) { return (V + 0x8000) >> 16; } - template <endianness E, uint8_t BSIZE, uint8_t SHIFT> static int64_t getPcRelocAddend(const uint8_t *Loc) { uint32_t Instr = read32<E>(Loc); @@ -1964,7 +1962,8 @@ static void applyMipsPcReloc(uint8_t *Loc, uint32_t Type, uint64_t V) { template <endianness E> static void writeMipsHi16(uint8_t *Loc, uint64_t V) { uint32_t Instr = read32<E>(Loc); - write32<E>(Loc, (Instr & 0xffff0000) | mipsHigh(V)); + uint16_t Res = ((V + 0x8000) >> 16) & 0xffff; + write32<E>(Loc, (Instr & 0xffff0000) | Res); } template <endianness E> |