Required DMD changes for Mir and few thoughts about D future

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 9 22:56:44 PDT 2016


On Saturday, 8 October 2016 at 18:10:14 UTC, Ilya Yaroshenko 
wrote:
> https://github.com/MartinNowak/druntime/blob/23373260e65af5edea989b61d6660832fedbec15/src/core/internal/arrayop.d#L78.
>
> Could you please give an example how it works for user?
> I mean aligned vs unaligned.

???

You could pack them like so.
float4 vec = loadUnaligned!float4(ptrToFloats);
float4 vec = loadAligned!float4(ptrToFloats);

The wrappers are only necessary because DMD/GDC/ldc have 
different SIMD implementations. Would be great if someone wrote a 
common basis library, unfortunately Manu's std.simd got stuck in 
progress.

> Does this is always inlined intrinsic (i mean this function has 
> not any its machine code in the object file / library e.g. 
> always inlined into the function body even in debug 
> compilaiton)?

D doesn't have macros and can't force inline, to inline w/o 
inliner you could use mixin templates, but relying on the inliner 
to do it's job would be cleaner.


More information about the Digitalmars-d mailing list