D for Game Development

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 9 00:53:47 PDT 2015


On 8/9/2015 12:36 AM, Iain Buclaw via Digitalmars-d wrote:
> What about intrinsics?
>
> https://github.com/D-Programming-Language/phobos/blob/94f718e5c69939f595fb839d3aae24878f126d78/std/math.d#L630

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.

For example:

   import std.math;
   double foo(double d) {
     return cos(d);
   }

generates:

   _D3foo3fooFdZd:
                 fld     qword ptr 4[ESP]
                 fcos
                 ret     8


More information about the Digitalmars-d mailing list