On 15 October 2012 02:50, jerro <span dir="ltr"><<a href="mailto:a@a.com" target="_blank">a@a.com</a>></span> wrote:<br><div class="gmail_quote"><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">
Speaking of test – are they available somewhere? Now that LDC at least theoretically supports most of the GCC builtins, I'd like to throw some tests at it to see what happens.<br>
<br>
David<br>
</blockquote>
<br></div>
I have a fork of std.simd with LDC support at <a href="https://github.com/jerro/phobos/tree/std.simd" target="_blank">https://github.com/jerro/<u></u>phobos/tree/std.simd</a> and some tests for it at <a href="https://github.com/jerro/std.simd-tests" target="_blank">https://github.com/jerro/std.<u></u>simd-tests</a> .<br>

</blockquote></div><br><div>Awesome. Pull request plz! :)</div><div><br></div><div>That said, how did you come up with a lot of these implementations? Some don't look particularly efficient, and others don't even look right.</div>
<div>xor for instance:</div><div><span class="k" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> return</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="k" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">cast</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">(</span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">T</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">)</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">(</span><span class="k" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">cast</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">(</span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">int4</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">)</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">v1</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">^</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="k" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">cast</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">(</span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">int4</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">)</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"> </span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">v2</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">);</span></div>
<div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">This is wrong for float types. x86 has separate instructions for doing this to floats, which make sure to do the right thing by the flags registers.</span></div>
<div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">Most of the LDC blocks assume that it could be any architecture... I don't think this will produce good portable code. It needs to be much more cafully hand-crafted, but it's a nice working start.</span></div>