[PATCH] D104744: [PowerPC] Add PowerPC rotate related builtins and emit target independent code for XL compatibility

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 15 06:50:22 PDT 2021


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

LGTM other than a couple of nits.



================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:15064
   }
+  case PPC::BI__builtin_ppc_rldimi:
+  case PPC::BI__builtin_ppc_rlwimi: {
----------------
Please add a comment describing the emitted code. Something like:
```
// Rotate and insert under mask operation.
// __rlwimi(rs, is, shift, mask)
// rotl(rs, shift) & mask) | (is & ~mask)
```


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:15070
+      Ops[2] = Builder.CreateZExt(Ops[2], Int64Ty);
+    Value *shift = Builder.CreateCall(F, {Ops[0], Ops[0], Ops[2]});
+    Value *X = Builder.CreateAnd(shift, Ops[3]);
----------------
Nit: `s/shift/Shift` to conform to variable naming conventions. Here and elsewhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104744



More information about the cfe-commits mailing list