www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Optimizations of DMD

reply Orgoton <orgoton mindless.com> writes:
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.
Mar 02 2007
parent reply janderson <askme me.com> writes:
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
Mar 02 2007
parent reply Howard Berkey <howard well.com> writes:
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.
Mar 02 2007
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
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.

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 -- Unlike Knuth, I have neither proven or tried the above; it may not even make sense. v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/
Mar 02 2007
next sibling parent Howard Berkey <howard well.com> writes:
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.

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
Mar 03 2007
prev sibling next sibling parent reply Benji Smith <dlanguage benjismith.net> writes:
Daniel Keep wrote:
 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...

Please do publish it. I'd like to teach myself some assembly programming, and it'd be nice to see someone else's code for inlining array operations with MMX instructions. If you don't post it at dsource, at least send me an email with the code attached. Thanks!! --benji
Mar 03 2007
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Benji Smith wrote:
 Daniel Keep wrote:
 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...

Please do publish it. I'd like to teach myself some assembly programming, and it'd be nice to see someone else's code for inlining array operations with MMX instructions. If you don't post it at dsource, at least send me an email with the code attached. Thanks!! --benji

Tracked it down, zipped it up, and attached it. However, keep in mind that this code is almost a year old, not extensively tested, and *very likely* won't compile. If you actually want to get it working, I suggest looking for implicit conversions from arrays to pointers and public/private import problems (default changed from public to private). I actually liked how this library was put together, even if it *was* fairly useless. At compile time, it selected one of a set of backends depending on version flags and what platform you were on. If your platform didn't have a fast parallel implementation available, it simply fell back on the software implementation. Code once, run anywhere, run really fast where possible :P Anyway, the assembler code should still work. I don't think it's all been very thoroughly tested, and there could be other errors or problems. But it might make a nice starting point. Incidentally, all of the code is public domain, so if anyone wants to take this and run with it, feel free. If anyone on the Tango project is interested, I'd still like to see something like this in Tango (or Phobos!) at some stage (better designed, I would hope). -- Daniel -- Unlike Knuth, I have neither proven or tried the above; it may not even make sense. v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/
Mar 06 2007
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hmm... forgot to attach it.  I tried uploading to my web-space, but it
looks like the ISP's decided to not publish user directories anymore :'(

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
Mar 06 2007
parent Benji Smith <dlanguage benjismith.net> writes:
Daniel Keep wrote:
 Hmm... forgot to attach it.  I tried uploading to my web-space, but it
 looks like the ISP's decided to not publish user directories anymore :'(

Thanks!!! --benji
Mar 06 2007
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Daniel Keep Wrote:

<snip>
 v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
 i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/

At first I thought that was a new means of munging email addresses. Now I see it's a new version of geek code. But is there any tool for decoding the version you've used, or is one supposed to do it manually? Stewart.
Mar 04 2007
next sibling parent =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= <jmjmak utu.fi.invalid> writes:
Stewart Gordon kirjoitti:
 Daniel Keep Wrote:
 
 <snip>
 v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
 i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/

At first I thought that was a new means of munging email addresses. Now I see it's a new version of geek code. But is there any tool for decoding the version you've used, or is one supposed to do it manually?

A true hacker probably automagically decodes it. :) The program on the website happily decrypts it after replacing v2 with v4.
Mar 04 2007
prev sibling next sibling parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Stewart Gordon wrote:
 Daniel Keep Wrote:
 
 <snip>
 v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
 i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/

At first I thought that was a new means of munging email addresses. Now I see it's a new version of geek code. But is there any tool for decoding the version you've used, or is one supposed to do it manually? Stewart.

I did write a Python script that would decode it, but that was ages ago and stuffed if I can find the damn thing... -- Daniel -- Unlike Knuth, I have neither proven or tried the above; it may not even make sense. v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/
Mar 04 2007
parent reply Dan <murpsoft hotmail.com> writes:
Sweet.  That's actually rather terse, and interesting...

sw7CSDhw5ln7pr7OSAPFck2ma5u6LSBw4Xl6GLSiOSciTE/e4t3b6AHen4g5VGPa2Xs6MRr8p-2/-5
hackerkey.com
Mar 05 2007
parent Dan <murpsoft hotmail.com> writes:
Dan Wrote:

They have a generator, good.  The one I just wrote up had bugs and missing
features.  : p

Here we are:
v4sw7+8CHSUhw5ln7pr7AFOPS$ck2ma5+8u6+7LOSw4Xm3l6GKLSiOSciTE/e4t3b6ADHen4a
Xs6/8MRr8p-2/-5g5GV hackerkey.com
Mar 05 2007
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Two other interesting observations.

1. "Keep the Guide up to date.  I can only promise I will either keep the guide
up to date or turn it over to someone who will.   Time will tell if I can keep
that promise."  It took me a while to notice that it was talking about keeping
the Guide up to date, not keeping Hacker Key itself up to date (which it
already isn't).

2. It isn't clear how they're making commercial use of the Hacker Key or even
planning to.

Stewart.
Mar 06 2007