Any usable SIMD implementation?

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 1 23:13:24 PDT 2016


On 2 Apr 2016 12:40 am, "Martin Nowak via Digitalmars-d" <
digitalmars-d at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160402/11034dc2/attachment.html>


More information about the Digitalmars-d mailing list