[lld] 8c53282 - [PowerPC][NFC] Merged two switch entries.
Stefan Pintilie via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 07:49:22 PDT 2020
Author: Stefan Pintilie
Date: 2020-09-25T09:49:13-05:00
New Revision: 8c53282d64b299a9543758988b1b480a88a93ae5
URL: https://github.com/llvm/llvm-project/commit/8c53282d64b299a9543758988b1b480a88a93ae5
DIFF: https://github.com/llvm/llvm-project/commit/8c53282d64b299a9543758988b1b480a88a93ae5.diff
LOG: [PowerPC][NFC] Merged two switch entries.
Two switch entries did exactly the same thing. This patch merges them.
Added:
Modified:
lld/ELF/Arch/PPC64.cpp
Removed:
################################################################################
diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp
index e367535dc7a1..06dd863f31b2 100644
--- a/lld/ELF/Arch/PPC64.cpp
+++ b/lld/ELF/Arch/PPC64.cpp
@@ -1259,17 +1259,7 @@ void PPC64::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
case R_PPC64_DTPREL64:
write64(loc, val - dynamicThreadPointerOffset);
break;
- case R_PPC64_PCREL34: {
- const uint64_t si0Mask = 0x00000003ffff0000;
- const uint64_t si1Mask = 0x000000000000ffff;
- const uint64_t fullMask = 0x0003ffff0000ffff;
- checkInt(loc, val, 34, rel);
-
- uint64_t instr = readPrefixedInstruction(loc) & ~fullMask;
- writePrefixedInstruction(loc, instr | ((val & si0Mask) << 16) |
- (val & si1Mask));
- break;
- }
+ case R_PPC64_PCREL34:
case R_PPC64_GOT_PCREL34:
case R_PPC64_GOT_TPREL_PCREL34:
case R_PPC64_TPREL34: {
More information about the llvm-commits
mailing list