Optimizations of DMD

Howard Berkey howard at well.com
Sat Mar 3 12:40:37 PST 2007


Daniel Keep Wrote:

> 
> 
> Howard Berkey wrote:
> > janderson Wrote:
> > 
> >> Orgoton wrote:
> >>> Does DMD perform processor specific optimizations? Does it make use of MMX, SSE and other such extensions? I am creating high performance applications and these optimizations would really come in handy.
> >> Not at the moment (as far as I know), although there have been some long 
> >> discussions about it.  Of course you can always do it in ASM. 
> >> Performance wise, you should be able to get near or better then C++.
> >>
> >> PS - I'm looking forward to seeing these in D as well.
> >>
> >> -Joel
> > 
> > 
> > I was thinking that some kind of standardized vector intrinsic interface would be really cool.  Think std.intrinsic or Tango's core.intrinsic, extended to vectorized types, with one interface for various underlying implementations.  I don't know enough about the functional overlap of AltiVec with x86 SIMD to know if it is feasible or not though, especially if things like alignment contraints are different for each set.
> > 
> 
> Some time ago, I wrote a simple library that extended arrays of basic
> types with parallel operations (like add, mult, madd, etc.) that were
> coded in MMX.  Never bothered to publish it since I wasn't sure if it
> was actually useful or not...
> 
> That said, it's certainly possible to add some of this stuff in library
> code.  It's definitely worth doing it if only because you need to teach
> yourself some assembler to do it.
> 
> 	-- Daniel
> 

My fear is that the SIMD operations themselves might not be orthogonal enough across various processors to be able to abstract anything but a small subset in a standardized way in a platform library like phobos or Tango.  I have not really looked in to them enough to know; this is just something that I am kind of tangentially interested in and I thought it would be cool if possible.

The other option of course is to have the compiler generate and use them internally when possible.  And of course the two options are not mutually exclusive either.

I think that D has a really good start on this now; having things like std.intrinsic in the standard librar(ies) is actually very nice.  Having alignment as a specifier baked into the language itself is also great; no more ugly compiler specific stuff like

#ifdef __GNUC__
__attribute__((aligned(16)));
#endif

or whatever.

But I digress from the original question :)

Howard




More information about the Digitalmars-d mailing list