[InstCombine] Signed saturation patterns
[llvm-complete.git] / lib / ExecutionEngine / RuntimeDyld / Targets / RuntimeDyldELFMips.h
blob14fb36f070f8ed95060ae3489b5f9286deb16fe5
1 //===-- RuntimeDyldELFMips.h ---- ELF/Mips specific code. -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
10 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_TARGETS_RUNTIMEDYLDELFMIPS_H
12 #include "../RuntimeDyldELF.h"
13 #include <string>
15 #define DEBUG_TYPE "dyld"
17 namespace llvm {
19 class RuntimeDyldELFMips : public RuntimeDyldELF {
20 public:
22 typedef uint64_t TargetPtrT;
24 RuntimeDyldELFMips(RuntimeDyld::MemoryManager &MM,
25 JITSymbolResolver &Resolver)
26 : RuntimeDyldELF(MM, Resolver) {}
28 void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
30 protected:
31 void resolveMIPSO32Relocation(const SectionEntry &Section, uint64_t Offset,
32 uint32_t Value, uint32_t Type, int32_t Addend);
33 void resolveMIPSN32Relocation(const SectionEntry &Section, uint64_t Offset,
34 uint64_t Value, uint32_t Type, int64_t Addend,
35 uint64_t SymOffset, SID SectionID);
36 void resolveMIPSN64Relocation(const SectionEntry &Section, uint64_t Offset,
37 uint64_t Value, uint32_t Type, int64_t Addend,
38 uint64_t SymOffset, SID SectionID);
40 private:
41 /// A object file specific relocation resolver
42 /// \param RE The relocation to be resolved
43 /// \param Value Target symbol address to apply the relocation action
44 uint64_t evaluateRelocation(const RelocationEntry &RE, uint64_t Value,
45 uint64_t Addend);
47 /// A object file specific relocation resolver
48 /// \param RE The relocation to be resolved
49 /// \param Value Target symbol address to apply the relocation action
50 void applyRelocation(const RelocationEntry &RE, uint64_t Value);
52 int64_t evaluateMIPS32Relocation(const SectionEntry &Section, uint64_t Offset,
53 uint64_t Value, uint32_t Type);
54 int64_t evaluateMIPS64Relocation(const SectionEntry &Section,
55 uint64_t Offset, uint64_t Value,
56 uint32_t Type, int64_t Addend,
57 uint64_t SymOffset, SID SectionID);
59 void applyMIPSRelocation(uint8_t *TargetPtr, int64_t CalculatedValue,
60 uint32_t Type);
65 #undef DEBUG_TYPE
67 #endif