[PATCH] D33236: [PowerPC] Implement vec_xxsldwi builtin.
Hiroshi Inoue via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 02:20:04 PDT 2017
inouehrs added inline comments.
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8479
+ assert(ArgCI && "Third argument must be a compile time constant");
+ int64_t Index = ArgCI->getZExtValue() & 0x3;
+ Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int32Ty, 4));
----------------
minor: uint64_t (or unsigned) for zext value?
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8484
+ // Create a shuffle mask
+ unsigned int ElemIdx0;
+ unsigned int ElemIdx1;
----------------
minor: `unsigned` is more common than `unsigned int`
================
Comment at: test/CodeGen/builtins-ppc-error.c:31
+void testXXSLDWI(void) {
+ int index = 5;
+ vec_xxsldwi(vsi); //expected-error {{too few arguments to function call, expected at least 3, have 1}}
----------------
Adding `const` is good here. (https://reviews.llvm.org/D33053#759232)
https://reviews.llvm.org/D33236
More information about the llvm-commits
mailing list