SIMD under LDC

Igor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 7 09:45:40 PDT 2017


On Thursday, 7 September 2017 at 15:24:13 UTC, Johan Engelen 
wrote:
> On Wednesday, 6 September 2017 at 20:43:01 UTC, Igor wrote:
>>
>> I opened a feature request on github. I also tried using the 
>> gccbuiltins but I got this error:
>>
>> LLVM ERROR: Cannot select: 0x2199c96fd70: v16i8 = 
>> X86ISD::PSHUFB 0x2199c74e9a8, 0x2199c74d6c0
>
> That's because SSSE3 instructions are not enabled by default, 
> so the compiler isn't allowed to generate the PSHUFB 
> instruction.
> Some options you have:
> 1. Set a cpu that has ssse3, e.g. compile with `-mcpu=native`
> 2. Enable SSSE3: compile with `-mattr=+ssse3`
> 3. Perhaps best for your case, enable SSSE3 for that function, 
> importing the ldc.attributes module and using the 
> @target("ssse3") UDA on that function.
>
> -Johan

Thanks Johan. I tried this and now it does compile but it crashes 
with Access Violation in debug build. In optimized build it seems 
to be working though.


More information about the Digitalmars-d-learn mailing list