[PATCH] D20239: [Power9] Add codegen for VSX word insert/extract instructions

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 06:03:04 PDT 2016


nemanjai added inline comments.

================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1500-1508
@@ -1493,1 +1499,11 @@
 
+/// isXXINSERTWMask - Return true if this VECTOR_SHUFFLE can be handled by
+/// the XXINSERTW instruction introduced in ISA 3.0. This is essentially any
+/// shuffle of v4f32/v4i32 vectors that just inserts one element from one vector
+/// into the other. This function will also set a couple of
+/// output parameters for how much the source vector needs to be shifted and
+/// what byte number needs to be specified for the instruction to put the
+/// element in the desired location of the target vector.
+bool PPC::isXXINSERTWMask(ShuffleVectorSDNode *N, unsigned &Op2Shift,
+                          unsigned &Op1Byte, bool &Swap, bool IsLE) {
+
----------------
amehsan wrote:
> I think people usually write comments for a member function in the header files and do not repeat the same comment in the implementation. It is natural to expect reader to go to header file if they are looking for comments, because for member variables and class, that is the only reasonable place to add a comment. 
> 
> My personal preference is not to replicate the comment twice. I'd like to see what others think about this.
In terms of comments in a single place, I agree that this makes sense (in case we want to change the comment, we don't have to change it in two places). However, all the other functions have the comments duplicated. It could be so that Doxygen picks them up in both files, but I don't really know.


Repository:
  rL LLVM

http://reviews.llvm.org/D20239





More information about the llvm-commits mailing list