SIMD under LDC

Igor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 4 13:39:11 PDT 2017


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 :)


More information about the Digitalmars-d-learn mailing list