<div class="gmail_quote">On 6 January 2012 16:06, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com">bearophileHUGS@lycos.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Manu:<br>
<div class="im"><br>
> To make it perform float4 math, or double2 match, you either write the<br>
> pseudo assembly you want directly, but more realistically, you use the<br>
> __float4 type supplied in the standard library, which will already<br>
> associate all the float4 related functionality, and try and map it across<br>
> various architectures as efficiently as possible.<br>
<br>
</div>I see. While you design, you need to think about the other features of D :-) Is it possible to mix CPU SIMD with D vector ops?<br>
<br>
__float4[10] a, b, c;<br>
c[] = a[] + b[];<br></blockquote><div><br></div><div>I don't see any issue with this. An array of vectors makes perfect sense, and I see no reason why arrays/slices/etc of hardware vectors should be any sort of problem.</div>
<div>This particular expression should be just as efficient as if it were an array of flat floats, especially if the compiler unrolls it.</div><div><br></div><div>D's array/slice syntax is something I'm very excited about actually in conjunction with hardware vectors. I could do some really elegant geometry processing with slices from vertex streams.</div>
</div>