Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-24 Thread bearophile
Don: > Yeah, at the moment you have to work at a higher level, you can't just > do a single instruction on its own. Is it possible to solve some of those problems adding something like this to D/DMD: http://www.dsource.org/projects/ldc/wiki/InlineAsmExpressions And then, what changes/work is n

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-24 Thread Max Klyga
On 2011-09-24 16:50:39 +0300, Manu said: Is there an IRC channel, or anywhere for realtime D discussion? There is a #d channel for general D discussions and #d.gdc for GDC related themes on irc.freenode.org

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-24 Thread so
On Sat, 24 Sep 2011 16:50:39 +0300, Manu wrote: Nice! Is there an IRC channel, or anywhere for realtime D discussion? I'm interested in trying to build some GDC cross compilers, and perhaps contributing to the standard library on a few embedded systems, but I have a lot of little questions an

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-24 Thread Manu
On 24 September 2011 15:37, Iain Buclaw wrote: > == Quote from Manu Evans (turkey...@gmail.com)'s article > > > > How can I do this in a nice way in D? I'm long sick of writing > > > > unsightly vector classes in C++, but fortunately using vendor > > > > specific compiler intrinsics usually leads

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-24 Thread so
On Fri, 23 Sep 2011 16:09:31 +0300, so wrote: It was there to show how it should be used in user code, and testing. Swizzle is not just a rvalue operation, there is also a lvalue part to it which plays a bit differently (hence, swizzleR and swizzleL). We could take care of it with an overload

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-24 Thread Iain Buclaw
== Quote from Manu Evans (turkey...@gmail.com)'s article > > > How can I do this in a nice way in D? I'm long sick of writing > > > unsightly vector classes in C++, but fortunately using vendor > > > specific compiler intrinsics usually leads to decent code > > > generation. I can currently imagine

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread Don
On 24.09.2011 00:47, Manu Evans wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 9/22/11 1:39 AM, Don wrote: On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At p

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread Don
On 22.09.2011 20:19, Marco Leise wrote: Am 22.09.2011, 19:26 Uhr, schrieb Peter Alexander : On 22/09/11 7:39 AM, Don wrote: On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread Manu Evans
== Quote from bearophile (bearophileh...@lycos.com)'s article > Manu Evans: > I appreciate your efforts. I answer to the OP that DMD doesn't yet offer most of the things discussed in this thread. But I think that it's better to add and work on high-performance features when the basics of D are in b

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread bearophile
Manu Evans: I appreciate your efforts. I answer to the OP that DMD doesn't yet offer most of the things discussed in this thread. But I think that it's better to add and work on high-performance features when the basics of D are in better shape. Currently there are more basic fishes to implemen

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread Manu Evans
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > On 9/22/11 1:39 AM, Don wrote: > > On 22.09.2011 05:24, a wrote: > >> How would one do something like this without intrinsics (the code is > >> c++ using > >> gcc vector extensions): > > > > [snip] > > At present, you can

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-23 Thread Manu Evans
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > D doesn't have __restrict. I'm going to argue that it is unnecessary. AFAIK, > __restrict is most used in writing vector operations. D, on the other hand, > has > a dedicated vector operation syntax: >a[] += b[] * c; > where

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-23 Thread so
On Fri, 23 Sep 2011 06:44:44 +0300, Andrei Alexandrescu wrote: On 9/22/11 9:11 PM, so wrote: On Fri, 23 Sep 2011 02:40:11 +0300, Andrei Alexandrescu wrote: On 9/22/11 6:00 PM, so wrote: On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu wrote: I think we should put swizzle in std

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Andrei Alexandrescu
On 9/22/11 9:11 PM, so wrote: On Fri, 23 Sep 2011 02:40:11 +0300, Andrei Alexandrescu wrote: On 9/22/11 6:00 PM, so wrote: On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu wrote: I think we should put swizzle in std.numeric once and for all. Is anyone interested in taking up that ta

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread so
On Fri, 23 Sep 2011 02:40:11 +0300, Andrei Alexandrescu wrote: On 9/22/11 6:00 PM, so wrote: On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu wrote: I think we should put swizzle in std.numeric once and for all. Is anyone interested in taking up that task? You mean some helper fu

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Andrei Alexandrescu
On 9/22/11 6:00 PM, so wrote: On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu wrote: I think we should put swizzle in std.numeric once and for all. Is anyone interested in taking up that task? You mean some helper functions to be used in user structures? I was thinking of a templat

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread so
On Fri, 23 Sep 2011 02:00:50 +0300, so wrote: It refuses to except a few things which i think it should. accept...

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread so
On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu wrote: I think we should put swizzle in std.numeric once and for all. Is anyone interested in taking up that task? You mean some helper functions to be used in user structures? Because i don't know of any structure in std.numerics t

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Walter Bright
On 9/22/2011 5:11 AM, a wrote: It also seems that the compiler doesn't inline functions containing asm. That's correct, it currently does not.

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Marco Leise
Am 22.09.2011, 19:26 Uhr, schrieb Peter Alexander : On 22/09/11 7:39 AM, Don wrote: On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it without ultimately resorting to inline

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-22 Thread Peter Alexander
On 22/09/11 1:38 AM, Walter Bright wrote: D doesn't have __restrict. I'm going to argue that it is unnecessary. AFAIK, __restrict is most used in writing vector operations. D, on the other hand, has a dedicated vector operation syntax: a[] += b[] * c; where a[] and b[] are required to not be ov

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Peter Alexander
On 22/09/11 7:39 AM, Don wrote: On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it without ultimately resorting to inline asm. But, what we've done is to move SIMD into the mach

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Marco Leise
Am 22.09.2011, 08:39 Uhr, schrieb Don : On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it without ultimately resorting to inline asm. But, what we've done is to move SIMD

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread Andrei Alexandrescu
On 9/22/11 1:39 AM, Don wrote: On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it without ultimately resorting to inline asm. But, what we've done is to move SIMD into the machi

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-22 Thread Benjamin Thaut
== Auszug aus Walter Bright (newshou...@digitalmars.com)'s Artikel > On 9/21/2011 10:56 PM, Benjamin Thaut wrote: > > Even if I manually allocate v1,v2 and result, the temporary variable that > > the > > compiler uses to compute the expression might be unaligned. > > That is a total killer for SSE

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-22 Thread a
> which compiles to a single shufps instruction. Doesn't it often require additional needless movaps instructions? For example, the following: asm { movaps XMM0, a; movaps XMM1, b; addps XMM0, XMM1; movaps a, XMM0; } asm { movaps XMM0, a; movaps XMM1, b; a

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-22 Thread Walter Bright
On 9/21/2011 10:56 PM, Benjamin Thaut wrote: Even if I manually allocate v1,v2 and result, the temporary variable that the compiler uses to compute the expression might be unaligned. That is a total killer for SSE optimizations because you can not hide them away. Does DMC++ have __declspec(align

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-22 Thread Kagamin
Manu Wrote: > I'd love to try out D on some console systems. Fortunately there are > some great home-brew scenes available for a bunch of slightly older > consoles; PSP/PS2 (MIPS), XBox1 (embedded x86), GameCube/Wii (PPC), > Dreamcast (SH4). They all have GCC compilers maintained by the > communit

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-21 Thread Don
On 22.09.2011 05:24, a wrote: How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): [snip] At present, you can't do it without ultimately resorting to inline asm. But, what we've done is to move SIMD into the machine model: the D machine model

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-21 Thread Benjamin Thaut
Am 22.09.2011 02:38, schrieb Walter Bright: nsightly vector classes in C++, but fortunately using vendor specific compiler intrinsics usually leads to decent code generation. I can currently imagine an equally ugly (possibly worse) hardware vector library in D, if it's even possible. But perhaps

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-21 Thread Iain Buclaw
== Quote from Manu (turkey...@gmail.com)'s article > Hello D community. > I've been reading a lot about D lately. I have known it existed for > ages, but for some reason never even took a moment to look into it. > The more I looked into it, the more I realise, this is the language > I want. C(/C++)

Re: __restrict, architecture intrinsics vs asm, consoles, and other

2011-09-21 Thread a
How would one do something like this without intrinsics (the code is c++ using gcc vector extensions): template struct Fft { typedef typename V::T T; typedef typename V::vec vec; static const int VecSize = V::Size; ... template static NOINLINE void fft_pass_interleaved( vec *

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-21 Thread Walter Bright
On 9/21/2011 3:55 PM, Manu wrote: Pointer aliasing... C implementations uses a non-standard __restrict keyword to state that a given pointer will not be aliased by any other pointer. This is critical in some pieces of code to eliminate redundant loads and stores, particularly important on RISC ar

Re: __restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-21 Thread Trass3r
I haven't seen any non-x86 examples of the D assembler, and I think it's fair to say that x86 is the single most unnecessary architecture to write inline assembly that exists. Are there PowerPC or ARM examples anywhere? Well DMD only supports x86 including inline asm so that's the only thing

__restrict, architecture intrinsics vs asm, consoles, and other stuff

2011-09-21 Thread Manu
Hello D community. I've been reading a lot about D lately. I have known it existed for ages, but for some reason never even took a moment to look into it. The more I looked into it, the more I realise, this is the language I want. C(/C++) has been ruined, far beyond salvation. D seems to be the re