<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 9 August 2015 at 09:53, Walter Bright via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 8/9/2015 12:36 AM, Iain Buclaw via Digitalmars-d wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What about intrinsics?<br>
<br>
<a href="https://github.com/D-Programming-Language/phobos/blob/94f718e5c69939f595fb839d3aae24878f126d78/std/math.d#L630" rel="noreferrer" target="_blank">https://github.com/D-Programming-Language/phobos/blob/94f718e5c69939f595fb839d3aae24878f126d78/std/math.d#L630</a><br>
</blockquote>
<br></span>
There isn't a simd cosine instruction, so making cos(double) builtin accomplishes nothing. However, the casting in those functions go away when code is generated.<br>
<br>
For example:<br>
<br>
  import std.math;<br>
  double foo(double d) {<br>
    return cos(d);<br>
  }<br>
<br>
generates:<br>
<br>
  _D3foo3fooFdZd:<br>
                fld     qword ptr 4[ESP]<br>
                fcos<br>
                ret     8<br>
</blockquote></div><br></div><div class="gmail_extra">This is on Windows?  I'm not seeing this on Linux.  <a href="http://goo.gl/58yhwU">http://goo.gl/58yhwU</a><br></div></div>