A Perspective on D from game industry

Sean Cavanaugh via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 00:39:43 PDT 2014


On 6/18/2014 1:05 AM, c0de517e wrote:
> On Wednesday, 18 June 2014 at 03:28:48 UTC, Sean Cavanaugh wrote:
>>
>> I had a nice sad 'ha ha' moment when I realized that msvc can't cope
>> with restrict on the pointers feeding into the simd intrinsics; you
>> have to cast it away.  So much for that perf :)
>
> http://blogs.msdn.com/b/vcblog/archive/2013/07/12/introducing-vector-calling-convention.aspx
>

VectorCall is all about working the original x64 ABI that only lets you 
officially pass float and double point scalars around in the xmm 
registers.   vectors require writing a bunch of helper forceinline 
functions that always operate on pointers or references, as passing by 
value lacked vectorcall, and on x86 pass by value for xmm types won't 
even compile.

Ultimately the code ends up with calls to you have to call something 
like _mm_store_ps or _mm_stream_ps etc, those are the functions that 
take pointers, and you have to cast away volatile (and afaik restrict is 
ignored on them as well but you don't to cast it away).



More information about the Digitalmars-d mailing list