<div dir="ltr"><div>Hi,</div><div><br></div><div>I love llvm vectors, yet I wonder why some advanced vector operations are specific to some CPU targets?</div><div><br></div><div>Let me take an example:</div><div><br></div>/// Horizontally adds the adjacent pairs of values contained in two<br>///    128-bit vectors of [4 x float].<br>///<br>/// \headerfile <x86intrin.h><br>///<br>/// This intrinsic corresponds to the <c> VHADDPS </c> instruction.<br>///<br>/// \param __a<br>///    A 128-bit vector of [4 x float] containing one of the source operands.<br>///    The horizontal sums of the values are stored in the lower bits of the<br>///    destination.<br>/// \param __b<br>///    A 128-bit vector of [4 x float] containing one of the source operands.<br>///    The horizontal sums of the values are stored in the upper bits of the<br>///    destination.<br>/// \returns A 128-bit vector of [4 x float] containing the horizontal sums of<br>///    both operands.<br>static __inline__ __m128 __DEFAULT_FN_ATTRS<br>_mm_hadd_ps(__m128 __a, __m128 __b)<br>{<br>  return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b);<br>}<br><div><br></div><div>Here clang will translate _mm_hadd_ps to a CPU specific feature.</div><div>Why not create __builtin_vector_hadd(a, b) which would select the CPU specific instruction or a fallback generic implementation?</div><div><br></div><div>Many thanks,</div><div>Alex</div></div>