www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Support for SIMD (Single Instruction Multiple Data)

reply Dominic <Dominic_member pathlink.com> writes:
Hello, most modern processors have an instruction set that allows them to
perform the same instruction on multiple data in parallel like MMX, SSE, SSE2 or
3DNOW on the x86 platform. I have never heard of a high level language where you
can make use of these. It would be a nice feature for D if it had instructions
or operators to use this kind of instructions in a generic, portable way,
without having to use complicated and platform dependant ASM code. Even if the
destination architecture don't support those operations, the compiler could
simply do the same instructions sequentially in a loop, making the code
portable, but faster when compiled for an architecture that support SIMD.
Feb 09 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Dominic wrote:

 Hello, most modern processors have an instruction set that allows them to
 perform the same instruction on multiple data in parallel like MMX, SSE, SSE2
or
 3DNOW on the x86 platform. I have never heard of a high level language where
you
 can make use of these. [...]
I'm using them from C/C++ on Mac OS X, if that counts ? http://developer.apple.com/documentation/MacOSX/Conceptual/ universal_binary/universal_binary_matrix_a/chapter_8_section_2.html It has intrinsics for AltiVec (PPC) and for SSE2 (X86), as both come with a C programming interface - AFAIK... GCC 4.x should do auto-vectorization, but I haven't stressed the GDC implentation to see what it means for actual D code... Hmm, *looks* like "-ftree-vectorizer-verbose=6" is a neat flag ? http://gcc.gnu.org/projects/tree-ssa/vectorization.html#status4.0 --anders
Feb 10 2006