<div dir="ltr">Hi Hao,<div><br></div><div>In arm_neon.h we have the following generated,</div><div><br></div><div>#define vshll_high_n_s8(a, __b) __extension__ ({ \<br></div><div><div>  int8x16_t __a = (a); \</div><div>  (int16x8_t)__builtin_neon_vshll_high_n_v(__a, __b, 33); })</div>
</div><div><br></div><div>Should this be changed to</div><div><br></div><div><div>#define vshll_high_n_s8(a, __b) __extension__ ({ \</div><div>  int64x2_t __a = (a); \</div><div>  (int16x8_t)vshll_n_s8(vget_high_s8(__a), __b); })</div>
</div><div><br></div><div>This would bring some benefits,</div><div>1) avoid defining new built-in __builtin_neon_vshll_high_n_v</div><div>2) the lowering in CGBuiltin.cpp can be simpler because we needn't to lower __builtin_neon_vshll_high_n_v any longer</div>
<div>3) this looks more natural to explain the semantics of long2/wide2 type of aarch64 neon instructions</div><div><br></div><div><div>+  if (isHigh){</div><div>+    unsigned NumElts = VTy->getNumElements();</div><div>
+    unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();</div><div>+    llvm::Type *EltTy =</div><div>+      llvm::IntegerType::get(VTy->getContext(), EltBits / 2);</div><div>+    // The source operand type has twice as many elements of half the size.</div>
<div>+    llvm::Type *SrcTy = llvm::VectorType::get(EltTy, NumElts * 2);</div><div>+    SmallVector<Constant*, 8> Indices;</div><div>+    for (unsigned i = 0; i != NumElts; i++)</div><div>+      Indices.push_back(Builder.getInt32(i + NumElts));</div>
<div>+    Value *SV = llvm::ConstantVector::get(Indices);</div><div>+    Value *Undef = llvm::UndefValue::get(SrcTy);</div><div>+    Ops[0] = Builder.CreateBitCast(Ops[0], SrcTy);</div><div>+    Ops[0] = Builder.CreateShuffleVector(Ops[0], Undef, SV);</div>
</div><div><br></div><div>This piece of code would be unnecessary.</div><div><br></div><div>Thanks,</div><div>-Jiangning</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/15 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hao,<br>
<br>
Thanks for that. The patches look good to me now. Go ahead and commit.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<div>-Jiangning</div>
</div>