DMD now incorporates a disassembler

Walter Bright newshound2 at digitalmars.com
Sun Jan 9 02:58:43 UTC 2022


On 1/8/2022 12:50 PM, max haughton wrote:
> On Saturday, 8 January 2022 at 18:47:11 UTC, Vladimir Marchevsky wrote:
>> On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
>>> Compile with -vasm to see it! Enjoy!
>>
>> Any practical reason to put disassembler into compiler instead of making it a 
>> separate tool?  Any ETA for renaming it into DMD Burning ROM? :)
> 
> Most other compilers have been able to do this for years.

I've never seen one. What's the switch for gcc to do the same thing?

> The only difference is 
> that the way the dmd backend is designed basically means that it never knows the 
> instructions in a given basic block until they are actually emitted, so it has 
> to disassemble it's own output rather than printing it's internal representation 
> with (say) Intel assembly syntax.
> 
> See https://llvm.org/doxygen/classllvm_1_1MachineInstr.html from LLVM
> 
> GCC actually *only* uses an assembler to build object files.

Compilers that take a detour through an assembler to generate code are 
inherently slower.

> It doesn't have a 
> distinct IR like LLVM does but the final stage of the RTL is basically a 1:1 
> representation of the instruction set:

That looks like intermediate code, not assembler.


More information about the Digitalmars-d-announce mailing list