Question on SSE intrinsics

piotrekg2 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 29 15:45:12 PDT 2017


On Saturday, 29 July 2017 at 18:19:47 UTC, Johan Engelen wrote:
> On Saturday, 29 July 2017 at 16:01:07 UTC, piotrekg2 wrote:
>> Hi,
>> I'm trying to port some of my c++ code which uses sse2 
>> instructions into D. The code calls the following intrinsics:
>>
>> - _mm256_loadu_si256
>> - _mm256_movemask_epi8
>>
>> Do they have any equivalent intrinsics in D?
>
> Yes, with LDC (probably GDC too).
> But unfortunately we don't have the "_mm256" functions (yet?), 
> instead we have GCC's "__builtin_ia32..." functions.
>
> The first one you mention I think is just an unaligned load? 
> That can be done with the template `loadUnaligned` from module 
> ldc.simd.
>
> The second one has a synonym, "__builtin_ia32_pmovmskb256".
>
> -Johan

What about __builtin_ctz?


More information about the Digitalmars-d-learn mailing list