digitalmars.D.learn - Generating assembly from dmd
- Joseph Rushton Wakeling (8/8) Dec 22 2013 Hi all,
- Kelet (10/19) Dec 22 2013 DMD never discretely generates assembly, which is why there is no
- Kelet (6/7) Dec 22 2013 To clarify, DMD goes straight from its intermediate
- Kelet (7/9) Dec 22 2013 Correction: obj2asm actually seems to come with DMD for Linux and
- Joseph Rushton Wakeling (3/6) Dec 22 2013 Hmm, is there a separate download? I'm running latest git-HEAD self-com...
- nazriel (4/13) Dec 22 2013 dmd -c ./file.d && objdump ./file.o -D -M intel
Hi all,
Can someone walk me through in a friendly way how to check the assembly
produced 
by dmd?  The application in this case is checking some new patches to Phobos. 
It's something I'm not familiar with doing in general and particularly not with 
dmd (which doesn't seem to have an assembly-output switch), so I'm hoping 
someone can advise :-)
Thanks & best wishes,
     -- Joe
 Dec 22 2013
On Sunday, 22 December 2013 at 14:17:50 UTC, Joseph Rushton
Wakeling wrote:
 Hi all,
 Can someone walk me through in a friendly way how to check the 
 assembly produced by dmd?  The application in this case is 
 checking some new patches to Phobos. It's something I'm not 
 familiar with doing in general and particularly not with dmd 
 (which doesn't seem to have an assembly-output switch), so I'm 
 hoping someone can advise :-)
 Thanks & best wishes,
     -- Joe
DMD never discretely generates assembly, which is why there is no
switch. There is obj2asm by Walter, but it is part of the paid
Digital Mars package (AFAIK). objconv[1] should work though, and
it is free.
Alternatively, if you don't mind GDC-generated assembly, you can
do it online quite easily[2].
[1]: http://www.agner.org/optimize/
[2]: http://d.godbolt.org/
 Dec 22 2013
On Sunday, 22 December 2013 at 14:31:44 UTC, Kelet wrote:DMD never discretely generates assemblyTo clarify, DMD goes straight from its intermediate representation (IR) of the code to the binary opcodes, which is part of the reason why it compiles faster relative to GDC or LDC. Regards, Kelet
 Dec 22 2013
On Sunday, 22 December 2013 at 14:31:44 UTC, Kelet wrote:There is obj2asm by Walter, but it is part of the paid Digital Mars package (AFAIK).Correction: obj2asm actually seems to come with DMD for Linux and Mac, but not Windows, where it seemingly needs to be purchased in the C and C++ Development System or Extended Utility Package[1] [1]: http://www.digitalmars.com/shop.html Regards, Kelet
 Dec 22 2013
On 22/12/13 15:42, Kelet wrote:Correction: obj2asm actually seems to come with DMD for Linux and Mac, but not Windows, where it seemingly needs to be purchased in the C and C++ Development System or Extended Utility Package[1]Hmm, is there a separate download? I'm running latest git-HEAD self-compiled DMD, so I never download any of the packages.
 Dec 22 2013
On Sunday, 22 December 2013 at 14:17:50 UTC, Joseph Rushton 
Wakeling wrote:
 Hi all,
 Can someone walk me through in a friendly way how to check the 
 assembly produced by dmd?  The application in this case is 
 checking some new patches to Phobos. It's something I'm not 
 familiar with doing in general and particularly not with dmd 
 (which doesn't seem to have an assembly-output switch), so I'm 
 hoping someone can advise :-)
 Thanks & best wishes,
     -- Joe
dmd -c ./file.d && objdump ./file.o -D -M intel
or drop -M intel if you prefer at&t
 Dec 22 2013








 
  
  
 
 "Kelet" <kelethunter gmail.com>
 "Kelet" <kelethunter gmail.com> 