SIMD under LDC

Johan Engelen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 7 08:24:13 PDT 2017


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


More information about the Digitalmars-d-learn mailing list