[PATCH] D118231: [ORC][AArch64] use isInt<N> to replace fitsRangeSignedInt on aarch64

Yifeng Dong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 03:05:57 PST 2022


dongAxis1944 updated this revision to Diff 403193.
dongAxis1944 added a comment.

update patch


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118231/new/

https://reviews.llvm.org/D118231

Files:
  llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp


Index: llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -51,7 +51,7 @@
       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 +65,6 @@
     }
     return Error::success();
   }
-
-  template <uint8_t Bits> static bool fitsRangeSignedInt(int64_t Value) {
-    return Value >= -(1ll << Bits) && Value < (1ll << Bits);
-  }
 };
 
 template <typename ELFT>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118231.403193.patch
Type: text/x-patch
Size: 792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220126/f74d9959/attachment.bin>


More information about the llvm-commits mailing list