Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
July 29, 2017 Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
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? I'm compiling my c++ code using gcc. Thanks, Piotr |
July 29, 2017 Re: Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
Posted in reply to piotrekg2 | 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? > > I'm compiling my c++ code using gcc. > > Thanks, > Piotr https://stackoverflow.com/questions/14002946/explicit-simd-code-in-d I don't think something has changed since then. |
July 29, 2017 Re: Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
Posted in reply to piotrekg2 | 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
|
July 29, 2017 Re: Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | 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?
|
July 30, 2017 Re: Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
Posted in reply to piotrekg2 | On Saturday, 29 July 2017 at 22:45:12 UTC, piotrekg2 wrote: > 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? https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L325 |
July 30, 2017 Re: Question on SSE intrinsics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | On Sunday, 30 July 2017 at 02:05:32 UTC, Nicholas Wilson wrote:
> On Saturday, 29 July 2017 at 22:45:12 UTC, piotrekg2 wrote:
>> What about __builtin_ctz?
>
> https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L325
you can also make it out of bsf or bsr (i can't remember which) from `core.bitop`
|
Copyright © 1999-2021 by the D Language Foundation