[llvm] df597bf - [NFC][ORC][AArch64] use isInt<N> to replace fitsRangeSignedInt on aarch64
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 26 07:27:07 PST 2022
Author: dongAxis
Date: 2022-01-26T23:26:31+08:00
New Revision: df597bf000b5c566e0f9218a53927daf9bc60f6d
URL: https://github.com/llvm/llvm-project/commit/df597bf000b5c566e0f9218a53927daf9bc60f6d
DIFF: https://github.com/llvm/llvm-project/commit/df597bf000b5c566e0f9218a53927daf9bc60f6d.diff
LOG: [NFC][ORC][AArch64] use isInt<N> to replace fitsRangeSignedInt on aarch64
Summary:
This is the first path to support more relocation types on aarch64.
The patch just uses the isInt<N> to replace fitsRangeSignedInt.
Test Plan:
check-all
Differential Revision: https://reviews.llvm.org/D118231
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
index a228c2ca0b233..dd3eb97c21a0e 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -16,6 +16,7 @@
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/ExecutionEngine/JITLink/aarch64.h"
#include "llvm/Object/ELFObjectFile.h"
+#include "llvm/Support/MathExtras.h"
#define DEBUG_TYPE "jitlink"
@@ -51,7 +52,7 @@ class ELFJITLinker_aarch64 : public JITLinker<ELFJITLinker_aarch64> {
if (static_cast<uint64_t>(Value) & 0x3)
return make_error<JITLinkError>("Call target is not 32-bit aligned");
- if (!fitsRangeSignedInt<27>(Value))
+ if (!isInt<28>(Value))
return makeTargetOutOfRangeError(G, B, E);
uint32_t RawInstr = *(little32_t *)FixupPtr;
@@ -65,10 +66,6 @@ class ELFJITLinker_aarch64 : public JITLinker<ELFJITLinker_aarch64> {
}
return Error::success();
}
-
- template <uint8_t Bits> static bool fitsRangeSignedInt(int64_t Value) {
- return Value >= -(1ll << Bits) && Value < (1ll << Bits);
- }
};
template <typename ELFT>
More information about the llvm-commits
mailing list