<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 16, 2010, at 10:50 AM, Sebastian Redl wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(117, 73, 44); "><br class="Apple-interchange-newline">#include<span class="Apple-converted-space"> </span><span style="color: rgb(203, 39, 34); "><stdio.h></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: rgb(183, 24, 162); ">int</span><span class="Apple-converted-space"> </span>main (<span style="color: rgb(183, 24, 162); ">int</span><span class="Apple-converted-space"> </span>argc,<span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">const</span><span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">char</span><span class="Apple-converted-space"> </span>* argv[])</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">   <span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">typedef</span><span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">short</span><span class="Apple-converted-space"> </span>_SSE_VecS16<span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">__attribute__</span><span class="Apple-converted-space"> </span>((__vector_size__ (<span style="color: rgb(59, 6, 215); ">16</span>)));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; ">    <br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">   <span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">register</span><span class="Apple-converted-space"> </span>_SSE_VecS16 b;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">   <span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">register</span><span class="Apple-converted-space"> </span>_SSE_VecS16 c;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">    __builtin_ia32_paddw128(b, c);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; ">    <br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">   <span class="Apple-converted-space"> </span><span style="color: rgb(183, 24, 162); ">return</span><span class="Apple-converted-space"> </span><span style="color: rgb(59, 6, 215); ">0</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">}</div></div></div></blockquote></div><br><div>IIRC, Clang intentionally doesn't have any built-ins for operations which are naturally modeled by operators. Either use the official SSE intrinsics, or use operators. Each built-in has a maintenance overhead, and such redundant ones aren't worth it, when b + c (or b += c?) does the same thing.</div></span><br class="Apple-interchange-newline"></blockquote></div><br><div>More specifically, please use the <xmmintrin.h> and related headers.  Those are the public, documented interfaces to the X86 vector instructions.  Using generic vectors is also a great option if you only care about targeting clang, not other compilers like GCC, ICC, MSVC etc.</div><div><br></div><div>-Chris</div></div></blockquote></div><br><div><div>Thanks for the info. We switched to <xmmintrin.h> and it now works as expected.</div><div><br></div><div>Alexandre</div></div></body></html>