A new calling convention in VS2013

2013-07-13 Thread bearophile
Through Reddit I've found an article about vector-calling-convention added to VS2013: http://blogs.msdn.com/b/vcblog/archive/2013/07/12/introducing-vector-calling-convention.aspx So I have written what I think is a similar D program: import core.stdc.stdio, core.simd; struct Particle { float

Re: A new calling convention in VS2013

2013-07-13 Thread Iain Buclaw
On Saturday, 13 July 2013 at 10:36:01 UTC, bearophile wrote: Through Reddit I've found an article about vector-calling-convention added to VS2013: http://blogs.msdn.com/b/vcblog/archive/2013/07/12/introducing-vector-calling-convention.aspx -- snip -- Are those vector calling conventions us

Re: A new calling convention in VS2013

2013-07-14 Thread Benjamin Thaut
Am 13.07.2013 12:35, schrieb bearophile: The resulting X86 asm: __D4test12addParticlesFNaNbxS4test8ParticlexS4test8ParticleZS4test8Particle: pushl%ebp movl%esp, %ebp andl$-16, %esp subl$16, %esp movaps40(%ebp), %xmm0 movaps56(%ebp), %xmm1

Re: A new calling convention in VS2013

2013-07-14 Thread bearophile
Benjamin Thaut: http://d.puremagic.com/issues/show_bug.cgi?id=10226 I see there are codegen inefficiencies. Until dmd uses the XMM registers correctly it doesn't make much sense to add a special calling convetion for this purpose. I don't agree, because: - Even if DMD codegen is far from

Re: A new calling convention in VS2013

2013-07-14 Thread Kagamin
Calling convention optimizations can probably be done during whole program optimization, which 1) usable for computation-intensive applications anyway, 2) guarantees invisibility of those fastcall functions to external code so there's no incompatibility.

Re: A new calling convention in VS2013

2013-07-14 Thread bearophile
Kagamin: Calling convention optimizations can probably be done during whole program optimization, which 1) usable for computation-intensive applications anyway, 2) guarantees invisibility of those fastcall functions to external code so there's no incompatibility. In D you can tag a free fun

Re: A new calling convention in VS2013

2013-07-14 Thread Benjamin Thaut
Am 14.07.2013 14:11, schrieb bearophile: Benjamin Thaut: http://d.puremagic.com/issues/show_bug.cgi?id=10226 I see there are codegen inefficiencies. Until dmd uses the XMM registers correctly it doesn't make much sense to add a special calling convetion for this purpose. I don't agree, b

Re: A new calling convention in VS2013

2013-07-14 Thread bearophile
Benjamin Thaut: I just wanted to say that there are currently bigger fish to fry then micro optimization through calling convetions. (GC, allocators, all the bugs...) I understand and I agree. On the other hand I think there are things that (if desired) it's better to introduce sooner, despi

Re: A new calling convention in VS2013

2013-07-16 Thread bearophile
Benjamin Thaut: If it is optimized I'M going to be disappointed by LDCs codegen.< Why? Bye, bearophile