[PATCH] D33572: [PPC] Implement fast bit reverse in PPCDAGToDAGISel

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 20:01:23 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/Target/PowerPC/PPCInstrInfo.td:4454
+
+def MaskValues {
+  dag Lo1 = (ORI (LIS 0x5555), 0x5555);
----------------
I realize that there are plenty of places online that explain the algorithm, but please add an explanation here as well (i.e. that we're exchanging pairs of bits, and then exchanging groups of two bits, etc.).


================
Comment at: lib/Target/PowerPC/PPCInstrInfo.td:4469
+def Swap1 {
+  dag Bit = (OR (AND Shift1.Right, MaskValues.Lo1), (AND Shift1.Left, MaskValues.Hi1));
+}
----------------
Please break this line, and the other swap patterns, so they're not so long (no need to exceed 80 cols here, it's likely more readable breaking this after the first argument to OR).


https://reviews.llvm.org/D33572





More information about the llvm-commits mailing list