Any usable SIMD implementation?

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 7 03:22:54 PDT 2016


Am Thu, 7 Apr 2016 02:41:06 -0700
schrieb Walter Bright <newshound2 at digitalmars.com>:

> > 3. This would not solve the problem for generic BLAS implementation
> > for Phobos at all! How you would force compiler to USE and NOT USE
> > specific vector permutations for example in the same object file?
> > Yes, I know, DMD has not permutations. No, I don't want to write
> > permutation for each architecture. Why? I can write simple D code
> > that generates single LLVM IR code which would work for ALL
> > targets!  
> 
> There's no reason for the compiler to make target CPU information
> available when writing generic code.

Actually for GDC/GCC you can't even write functions using certain SIMD
stuff as 'generic' code. Unless you use -mavx or -march the builtins
are not exposed to user code. IIRC the compiler even complains about
inline ASM if you use unsupported instructions.

You also can't always compile with the 'biggest' feature set, as GCC
might use these features in codegen.

TLDR;
For GCC/GDC you will have to use target flags / @attribute(target) to
mix feature sets.


More information about the Digitalmars-d mailing list