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 only accepts constant masks and I am using a variable one. Is this possible under LDC?

BTW. Shuffling channels within pixels using DMD simd is about 5 times faster than with normal code on my machine :)

Reply via email to