4 ms·
No worries. The 6g version is now live but I suspect it doesn't do the code generator justice. It seems 6l also does some kind of optimisation and my hacks vers
by mattgodbolt 12y ago
No worries. The 6g version is now live but I suspect it doesn't do the code generator justice. It seems 6l also does some kind of optimisation and my hacks version o just running 6g -S isn't showing that up.
- 4ad 12y agoPreviously, 6l did some pretty significant changes to the code generated by 6g, e.g. the stack split prologue was generated in 6l. Back then, you could use 6l -a to see the final version. More recently (since 1.3) the code generation part of the linker was refactored into a library, liblink, and the compiler links with this library. Now 6g -S is pretty close to the final code, although there still are some things done by 6l. Unfortunately, the -a flag was lost. We have new disassemblers however; go tool objdump will dissasemble Go binaries and will show you the final version of the code. Unlike GNU objdump, the Go objdump understands Go binaries better and can print in normal Plan 9 assembly syntax (well normal for Go, anyway).
- mattgodbolt 12y agoCool! I will give that a go. The rest of the site is pretty geared around annotated assembler from the compiler but I've been meaning to add objdump like support for a while (if only to see things like opcode lengths for I-cache observations). This may be the excuse to support that for both GNU and Plan 9 output.