On 2 Apr 2016 12:40 am, "Martin Nowak via Digitalmars-d" < digitalmars-d@puremagic.com> wrote: > > On 03/31/2016 10:55 AM, ZombineDev wrote: > > [2]: https://github.com/D-Programming-Language/phobos/pull/2862 > > Well apparently stores w/ dmd's weird core.simd interface don't work, or > I can't figure out (from the non-existent documentation) how to use it. > > --- > import core.simd; > > void test(float4* ptr, float4 val) > { > __simd_sto(XMM.STOUPS, *ptr, val); > __simd(XMM.STOUPS, *ptr, val); > auto val1 = __simd_sto(XMM.STOUPS, *ptr, val); > auto val2 = __simd(XMM.STOUPS, *ptr, val); > } > --- > > LDC at least has some intrinsics once you find ldc.gccbuiltins_x86, but > for some reason comes with it's own broken ldc.simd.loadUnaligned > instead of providing intrinsics. > > --- > import core.simd, ldc.simd; > > float4 test(float* ptr) > { > return loadUnaligned!float4(ptr); > } > --- > > /home/dawg/dlang/ldc-0.17.1/bin/../import/ldc/simd.di(212): Error: can't > parse inline LLVM IR: > %r = load <4 x float>* %p, align 1 > ^ > expected comma after load's type > > So are 3 different untested and unused APIs really the current state of > SIMD? > > -Martin >
I would just let the compiler optimize / vectorize the operation, but then again that it is probably just me who thinks these things. http://goo.gl/XdiKZX I'm not aware of any intrinsic to load unaligned data. Only to assume alignment. Iain.