trim-go-asm

Crates.iotrim-go-asm
lib.rstrim-go-asm
version0.1.3
sourcesrc
created_at2021-10-30 11:17:24.390859
updated_at2022-02-25 03:46:54.581684
descriptionTrim Go Assembly from $ go tool compile -S
homepage
repositoryhttps://github.com/ggvm-org/trim-go-asm
max_upload_size
id474355
size24,244
Krouton (Krout0n)

documentation

README

trim-go-asm

Trim Go Assembly from $ go tool compile -S

Install

$ cargo install trim-go-asm

How to use

Version 0.1 can parse input only from stdin. So, $ go tool compile -S x.go > trim-go-asm is the most likely use case.

Contributing

Any contributions are welcome!

TODOs

  • Read from file by option.
  • Accept *.go by option, then run go tool compile -S <filename>.go | trim-go-asm > <filename>.s
  • Specify the output path by -o
  • THIS IS FOR ME Add subcommand for-me
USAGE:
    trim-go-asm [OPTIONS]

OPTIONS:
        --fm         todo!
    -h, --help       Print help information
        --ra         Replace `ABIInternal` to 4(NOSPLIT)
        --rpf        Remove PCDATA and FUNCDATA insts, if you want to enable this option, you must
                     enable --tg too.
        --tg         Trim Goroutine prologue / epilogue
                     // Trim these instructions.
                     MOVQ       (TLS), CX
                     CMPQ       SP, 16(CX)
                     PCDATA     $0, $-2
                     JLS        70
                     PCDATA     $0, $-1
                     // ...
                     NOP
                     PCDATA     $1, $-1
                     PCDATA     $0, $-2
                     CALL       runtime.morestack_noctxt(SB)
                     PCDATA     $0, $-1
                     JMP        0
    -V, --version    Print version information
Commit count: 31

cargo fmt