[lld] r251118 - ELF2: Do not apply 0xffff bit mask to uint16_t return values. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 09:54:58 PDT 2015


Author: ruiu
Date: Fri Oct 23 11:54:58 2015
New Revision: 251118

URL: http://llvm.org/viewvc/llvm-project?rev=251118&view=rev
Log:
ELF2: Do not apply 0xffff bit mask to uint16_t return values. NFC.

Modified:
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=251118&r1=251117&r2=251118&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Fri Oct 23 11:54:58 2015
@@ -334,21 +334,12 @@ void X86_64TargetInfo::relocateOne(uint8
 // #higher(value), #highera(value), #highest(value), and #highesta(value)
 // macros defined in section 4.5.1. Relocation Types of the PPC-elf64abi
 // document.
-
-static uint16_t applyPPCLo(uint64_t V) { return V & 0xffff; }
-
-static uint16_t applyPPCHi(uint64_t V) { return (V >> 16) & 0xffff; }
-
-static uint16_t applyPPCHa(uint64_t V) { return ((V + 0x8000) >> 16) & 0xffff; }
-
-static uint16_t applyPPCHigher(uint64_t V) { return (V >> 32) & 0xffff; }
-
-static uint16_t applyPPCHighera(uint64_t V) {
-  return ((V + 0x8000) >> 32) & 0xffff;
-}
-
+static uint16_t applyPPCLo(uint64_t V) { return V; }
+static uint16_t applyPPCHi(uint64_t V) { return V >> 16; }
+static uint16_t applyPPCHa(uint64_t V) { return (V + 0x8000) >> 16; }
+static uint16_t applyPPCHigher(uint64_t V) { return V >> 32; }
+static uint16_t applyPPCHighera(uint64_t V) { return (V + 0x8000) >> 32; }
 static uint16_t applyPPCHighest(uint64_t V) { return V >> 48; }
-
 static uint16_t applyPPCHighesta(uint64_t V) { return (V + 0x8000) >> 48; }
 
 PPC64TargetInfo::PPC64TargetInfo() {




More information about the llvm-commits mailing list