<div class="gmail_quote">On 15 January 2012 08:16, Sean Cavanaugh <span dir="ltr"><<a href="mailto:WorksOnMyMachine@gmail.com">WorksOnMyMachine@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 1/15/2012 12:09 AM, Walter Bright wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 1/14/2012 9:58 PM, Sean Cavanaugh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
MS has three types, __m128, __m128i and __m128d (float, int, double)<br>
<br>
Six if you count AVX's 256 forms.<br>
<br>
On 1/7/2012 6:54 PM, Peter Alexander wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 7/01/12 9:28 PM, Andrei Alexandrescu wrote:<br>
I agree with Manu that we should just have a single type like __m128 in<br>
MSVC. The other types and their conversions should be solvable in a<br>
library with something like strong typedefs.<br>
<br>
</blockquote></blockquote>
<br>
The trouble with MS's scheme, is given the following:<br>
<br>
__m128i v;<br>
v += 2;<br>
<br>
Can't tell what to do. With D,<br>
<br>
int4 v;<br>
v += 2;<br>
<br>
it's clear (add 2 to each of the 4 ints).<br>
</blockquote>
<br></div></div>
Working with their intrinsics in their raw form for real code is pure insanity :)  You need to wrap it all with a good math library (even if 90% of the library is the intrinsics wrapped into __forceinlined functions), so you can start having sensible operator overloads, and so you can write code that is readable.<br>

<br>
<br>
if (any4(a > b))<br>
{<br>
  // do stuff<br>
}<br>
<br>
<br>
is way way way better than (pseudocode)<br>
<br>
if (__movemask_ps(_mm_gt_ps(a, b)) == 0x0F)<br>
{<br>
}<br>
<br>
<br>
<br>
and (if the ternary operator was overrideable in C++)<br>
<br>
float4 foo = (a > b) ? c : d;<br>
<br>
would be better than<br>
<br>
float4 mask = _mm_gt_ps(a, b);<br>
float4 foo = _mm_or_ps(_mm_and_ps(mask, c), _mm_nand_ps_(mask, d));<br></blockquote><div><br></div><div>Yep, it's coming... baby steps :)</div><div><br></div><div>Walter: I told you games devs would be all over this! :P</div>
</div>