[PATCH] D26546: [PPC] Add vec_insert4b/vec_extract4b to altivec.h

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 13 17:45:06 PST 2016


nemanjai added inline comments.


================
Comment at: lib/Headers/altivec.h:11908
+#define vec_extract4b(__a, __b)                                                \
+   vec_reve((vector unsigned long long)                                        \
+                __builtin_vsx_xxextractuw((__a), (12 - (__b & 0xF))))
----------------
I find it difficult to follow and understand this logic when it's in the header.
What I'd prefer to see here is that the macro simply expands into `__builtin_vsx_xxextractuw` and then handle all this logic in the code that emits an intrinsic call.
Namely if the target is little endian, we adjust the parameter, emit the intrinsic call and finally emit a shufflevector.


Repository:
  rL LLVM

https://reviews.llvm.org/D26546





More information about the cfe-commits mailing list