<div class="gmail_quote">On 12 January 2012 02:46, F i L <span dir="ltr"><<a href="mailto:witte2008@gmail.com">witte2008@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="im">Well the idea is you can have both. You could even have a:</div>
<br>
   Vector2!(Transition!(Vector4!(<u></u>Transition!float))) // headache<br>
   or something more practical...<br>
<br>
   Vector4!(Vector4!float) // Matrix4f<br>
   Vector4!(Transition!(Vector4!<u></u>float)) // Smooth Matrix4f<br>
<br>
Or anything like that. I should point out that my example didn't make it clear that a Matrix4!(Transition!float) would be pointless compared to Transition!(Matrix4!float) unless each Transition held it's own iteration value. Example:<br>

<br>
   struct Transition(T, bool isTimer = false) {<div class="im"><br>
       T value, start, target;<br>
       alias value this;<br>
<br></div>
       static if (isTimer) {<br>
           float time, speed;<br>
<br>
           void update() {<br>
               time += speed;<br>
               value = start + ((target - start) * time);<br>
           }<br>
       }<br>
   }<br>
<br>
That way each channel could update on it's own time frame. There may even be a way to have each channel be it's own separate Transition type. Which could be interesting. I'm still playing with possibilities.</blockquote>
<div><br></div><div>The vector's aren't quite like that.. you can't make a hardware vector out of anything, only things the hardware supports: __vector(float[4]) for instance.</div><div>You can make your own vector template that wraps those I guess if you want to make a matrix that way, but it sounds inefficient. When it comes to writing the vector/matrix operations, if you're assuming generic code, you won't be able to make it anywhere near as good as if you write a Matrix4x4 class.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think that is also possible if that's what you want to do, and I see no<br>
reason why any of these constructs wouldn't be efficient (or supported).<br>
You can probably even try it out now with what Walter has already done...<br>
</blockquote>
<br></div>
Cool, I was unaware Walter had begun implementing SIMD operations. I'll have to build DMD and test them out. What's the syntax like right now?<br></blockquote><div><br></div><div>The syntax for the types (supporting basic arithmetic) look like __vector(float[4]) float4vector.. Try it on the latest GDC.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was under the impression you would be helping him here, or that you would be building the SIMD-based math libraries. Or something like that. That's why I was posting my examples in question to how the std.simd lib would compare.<br>

</blockquote></div><br><div>I know nothing of DMD. Then the type semantics and opcode intrinsics are working, I'll happily write the fiddly library, and I'm using GDC for my own experiment in the mean time while Walter works on the code gen.</div>