Re: SIMD under LDC

2017-09-11 Thread Igor via Digitalmars-d-learn
On Monday, 11 September 2017 at 11:55:45 UTC, Igor wrote: In the meantime can anyone tell me how to add an attribute to a function only if something is defined, since this doesn't work: version(USE_SIMD_WITH_LDC) { import ldc.attributes; @target("ssse3") } void funcThatUsesSIMD() { ...

Re: SIMD under LDC

2017-09-11 Thread Igor via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:45:40 UTC, Igor wrote: 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

Re: SIMD under LDC

2017-09-07 Thread Igor via Digitalmars-d-learn
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

Re: SIMD under LDC

2017-09-07 Thread Johan Engelen via Digitalmars-d-learn
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

Re: SIMD under LDC

2017-09-06 Thread Igor via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 09:01:18 UTC, Igor wrote: On Tuesday, 5 September 2017 at 18:50:34 UTC, Johan Engelen wrote: On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote: I found that I can't use __simd function from core.simd under LDC and that it has ldc.simd but I couldn't find

Re: SIMD under LDC

2017-09-06 Thread Igor via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 18:50:34 UTC, Johan Engelen wrote: On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote: I found that I can't use __simd function from core.simd under LDC and that it has ldc.simd but I couldn't find how to implement equivalent to this with it: ubyte16*

Re: SIMD under LDC

2017-09-05 Thread Johan Engelen via Digitalmars-d-learn
On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote: I found that I can't use __simd function from core.simd under LDC and that it has ldc.simd but I couldn't find how to implement equivalent to this with it: ubyte16* masks = ...; foreach (ref c; pixels) { c = __simd(XMM.PSHUFB,

Re: SIMD under LDC

2017-09-05 Thread Igor via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 01:11:29 UTC, 12345swordy wrote: On Monday, 4 September 2017 at 23:06:27 UTC, Nicholas Wilson wrote: Don't underestimate ldc's optimiser ;) I seen cases where the compiler fail to optimized for smid. I tried it and LDC optimized build did generate SIMD

Re: SIMD under LDC

2017-09-04 Thread 12345swordy via Digitalmars-d-learn
On Monday, 4 September 2017 at 23:06:27 UTC, Nicholas Wilson wrote: On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote: I found that I can't use __simd function from core.simd under LDC Correct LDC does not support the core.simd interface. and that it has ldc.simd but I couldn't find

Re: SIMD under LDC

2017-09-04 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 4 September 2017 at 20:39:11 UTC, Igor wrote: I found that I can't use __simd function from core.simd under LDC Correct LDC does not support the core.simd interface. and that it has ldc.simd but I couldn't find how to implement equivalent to this with it: ubyte16* masks = ...;

SIMD under LDC

2017-09-04 Thread Igor via Digitalmars-d-learn
I found that I can't use __simd function from core.simd under LDC and that it has ldc.simd but I couldn't find how to implement equivalent to this with it: ubyte16* masks = ...; foreach (ref c; pixels) { c = __simd(XMM.PSHUFB, c, *masks); } I see it has shufflevector function but it