[PATCH] D80907: [PowerPC] refactor convertToImmediateForm - NFC

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 20:28:09 PDT 2020


shchenz marked an inline comment as done.
shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3396
+    InVal = InVal.rotl(SH);
+    uint64_t Mask = MB == 0 ? -1LLU : (1LLU << (63 - MB + 1)) - 1;
+    InVal &= Mask;
----------------
steven.zhang wrote:
> Maybe, this is another case that can be improved with the APInt utility to make the code more clear.
Because `InVal` can be 32 or 64 bit width, we need to create different width Mask for them. But `InVal &= Mask` handles 32/64 bit raw integer automatically.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80907





More information about the llvm-commits mailing list