Jump to page: 1 2 3
Thread overview
DMD now incorporates a disassembler
Jan 07, 2022
Walter Bright
Jan 07, 2022
dd
Jan 07, 2022
Dukc
Jan 09, 2022
max haughton
Jan 10, 2022
Walter Bright
Jan 08, 2022
Elronnd
Jan 09, 2022
Walter Bright
Jan 09, 2022
rikki cattermole
Jan 08, 2022
Brian Callahan
Jan 09, 2022
Walter Bright
Jan 08, 2022
ag0aep6g
Jan 08, 2022
H. S. Teoh
Jan 09, 2022
Walter Bright
Jan 08, 2022
Imperatorn
Jan 08, 2022
Andre Pany
Jan 08, 2022
jmh530
Jan 08, 2022
max haughton
Jan 08, 2022
H. S. Teoh
Jan 08, 2022
max haughton
Jan 09, 2022
Walter Bright
Jan 09, 2022
max haughton
Jan 09, 2022
Walter Bright
Jan 09, 2022
Walter Bright
Jan 10, 2022
Patrick Schluter
Jan 09, 2022
Walter Bright
January 07, 2022
Compile with -vasm to see it! Enjoy!

For the file test.d:

  int demo(int x)
  {
    return x * x;
  }

Compiling with:

  dmd test.d -c -vasm

prints:

  _D4test4demoFiZi:
  0000:   89 F8                   mov     EAX,EDI
  0002:   0F AF C0                imul    EAX,EAX
  0005:   C3                      ret


https://github.com/dlang/dmd/pull/13447
January 07, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!

Oh very nice! I need to finish my debugger/disassembler project.
January 07, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!
>
> For the file test.d:
>
>   int demo(int x)
>   {
>     return x * x;
>   }
>
> Compiling with:
>
>   dmd test.d -c -vasm
>
> prints:
>
>   _D4test4demoFiZi:
>   0000:   89 F8                   mov     EAX,EDI
>   0002:   0F AF C0                imul    EAX,EAX
>   0005:   C3                      ret
>
>
> https://github.com/dlang/dmd/pull/13447

Wow, very useful! This feature surely lowers the bar to check the disassembly when optimising. Thanks!

I'm slightly disappointed it does not output the asm inlined to D code but that's just my daydreaming with no practical reasons to back it up.
January 08, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
>   0000:   89 F8                   mov     EAX,EDI

Feature request: octal.
January 08, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!
>
> For the file test.d:
>
>   int demo(int x)
>   {
>     return x * x;
>   }
>
> Compiling with:
>
>   dmd test.d -c -vasm
>
> prints:
>
>   _D4test4demoFiZi:
>   0000:   89 F8                   mov     EAX,EDI
>   0002:   0F AF C0                imul    EAX,EAX
>   0005:   C3                      ret
>
>
> https://github.com/dlang/dmd/pull/13447

Thanks Walter. This is quite useful. Will put it through its paces. Already spotted some print formatting weirdness; will send as bug reports.

~Brian
January 08, 2022
On 07.01.22 22:41, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!

With feature creep in full swing now, when can I expect to read my email with DMD?
January 07, 2022
On Sat, Jan 08, 2022 at 07:39:54AM +0100, ag0aep6g via Digitalmars-d-announce wrote:
> On 07.01.22 22:41, Walter Bright wrote:
> > Compile with -vasm to see it! Enjoy!
> 
> With feature creep in full swing now, when can I expect to read my email with DMD?

You already can:

	echo 'import std;void main(){execute("/usr/bin/mail");}' | dmd -run -

:-P


T

-- 
"Real programmers can write assembly code in any language. :-)" -- Larry Wall
January 08, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!
>
> For the file test.d:
>
>   int demo(int x)
>   {
>     return x * x;
>   }
>
> Compiling with:
>
>   dmd test.d -c -vasm
>
> prints:
>
>   _D4test4demoFiZi:
>   0000:   89 F8                   mov     EAX,EDI
>   0002:   0F AF C0                imul    EAX,EAX
>   0005:   C3                      ret
>
>
> https://github.com/dlang/dmd/pull/13447

Nice!
January 08, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!
>
> For the file test.d:
>
>   int demo(int x)
>   {
>     return x * x;
>   }
>
> Compiling with:
>
>   dmd test.d -c -vasm
>
> prints:
>
>   _D4test4demoFiZi:
>   0000:   89 F8                   mov     EAX,EDI
>   0002:   0F AF C0                imul    EAX,EAX
>   0005:   C3                      ret
>
>
> https://github.com/dlang/dmd/pull/13447

Great news, this worth a hn / reddit post!

Kind regards
Andre
January 08, 2022
On Friday, 7 January 2022 at 21:41:55 UTC, Walter Bright wrote:
> Compile with -vasm to see it! Enjoy!
>
> [snip]

Would make a nice project for someone to integrate this into run.dlang.org
« First   ‹ Prev
1 2 3