Thanks for the good work! It would be really nice if in the
future we could compare DMD, GDC and LDC (and SDC when it
becomes more usable) at asm.dlang.org. (Btw a nice choice of name
I have a couple of questions about the output when looking at a
C++ program and the same in GDC and DMD(I am not very
familiar with assembly):
AFAIU, (_D)main pushes 3 and 4 to the stack and calls
(example.)add. Then (example.)add loads them from the stack in
two registers and adds them.
IIRC, dmd passes parameters in reverse order (of the normal C
way) and that's why pushing and loading 3 and 4 from the stack is
in reverse order.
However why does DMD use hex instead of decimal notation?
[I was also a little confused about positive vs negative indexing
of bp and the order of src and dst in the arguments to movl, but
then I noticed that I am comparing x86 and x86_64, so I managed
to answer those questions myself :D ]
I also noticed that the output of gdc-4.4 and gdc-4.6 does not
include a label for _Dmain (nor the regular C main). Is this a
problem of the disassembly, or just how older version of GDC
: http://goo.gl/mUQKiX (permalink at http://gcc.godbolt.org/)
: http://goo.gl/CmYbrZ (permalink at http://explore.dgnu.org/)
: http://goo.gl/ZHHVuZ (permalink at http://asm.dlang.org/)
On Monday, 26 January 2015 at 23:46:24 UTC, Iain Buclaw wrote:
It is my pleasure to release a new site onto the community. An
Interactive DMD compiler.
Inspired by Matt Godbolt's GCC Explorer, and my own hosted
version that uses GDC. I was asked by Andrei to fork and
make a working protoype that uses DMD.
All work is hosted on Github, and we are planning on moving
it to part of the D-Programming-Language repositories.
Please share, contribute, and destroy!