[PATCH] D99449: [GlobalISel] Implement lowering for G_ROTR and G_ROTL.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 10:57:48 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:5382
+  unsigned ShOpc = IsLeft ? TargetOpcode::G_SHL : TargetOpcode::G_LSHR;
+  unsigned HsOpc = IsLeft ? TargetOpcode::G_LSHR : TargetOpcode::G_SHL;
+  auto BitWidthMinusOneC = MIRBuilder.buildConstant(AmtTy, EltSizeInBits - 1);
----------------
aemerson wrote:
> foad wrote:
> > What does "Hs" mean?
> Good question. This was a port of some code that you wrote in TargetLowering, do you remember?
Curses! Actually it predates me and originally comes from D47725. My only guess is that it's a cute way of indicating a reverse shift by "reversing" the letters S H, in which case I think it's //too// cute, and not in a good way.

I'll leave it up to you whether to change it to something more understandable or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99449



More information about the llvm-commits mailing list