🌐 Website · 📚 Documentation
Ergonomic generation of Go-compatible Plan 9 assembly for every 64-bit Go target — amd64, arm64, riscv64, loong64, ppc64le (VSX) and s390x (vector facility, big-endian).
avo does this for amd64 by encoding instruction bytes itself — powerful,
but exactly what makes extending it to new ISAs expensive. go-asmgen instead
emits Plan 9 assembly text and lets the Go toolchain assembler (cmd/asm)
encode it, so each architecture is just a thin move/register surface over a
shared ABI0 layout model — not a byte-level encoder. avo stays the richer choice
for amd64-specific work; go-asmgen's niche is one uniform builder across every
target.
| Repo | What it is |
|---|---|
| asmgen | the library: shared ABI0 layout (abi) + per-arch builders (amd64/arm64/riscv64/loong64/ppc64le/s390x) + Plan 9 writer (emit) |
| docs | MkDocs Material documentation, served at /docs/ |
| go-asmgen.github.io | the Hugo landing page |
| brand | brand assets — logos & icons |
- Delegate encoding to
cmd/asm. Emitting text, not bytes, is what keeps adding an architecture cheap and keeps every instruction encoded by the same toolchain that compiles the rest of the program. The exception is an instructioncmd/asmcannot assemble yet. Those are the ppc64le VSX float64 arithmetic (XVADDDP…) and the loong64 vector fused multiply-add (VFMADDD…). go-asmgen emits each one as aWORDwhose comment gives the spelling proposed forcmd/asm, and keeps its encoding, references and proposed spelling in a registry (internal/gap). From that registry come the Go patches ingoasm-patches/, and a weekly check that notices when Go catches up. Since v0.15.0 the arm64 vector float64 arithmetic (VFADD2D…) and the loong64 broadcast load are encoded bycmd/asm. - Target ABI0, not ABIInternal. ABI0 (stack-based, FP-relative) is the
stable contract hand-written
.stargets; ABIInternal can change between Go releases. - Verified by
go vetasmdecl. Every emittedname+offset(FP)is cross-checked against the Go declaration in CI, and exercised by a runtime test — natively on amd64 and arm64, under qemu-user for riscv64, loong64, ppc64le and s390x (the s390x job exercising the big-endian path). - 100% test coverage of the library, enforced as a CI gate on every repository.
- Security policy. The emitted assembly runs outside Go's memory safety, so a wrong encoding is a vulnerability: SECURITY.md says what counts and how to report it privately. CI runs govulncheck.
Released — go get github.com/go-asmgen/asmgen@latest (latest v0.16.0, which requires Go 1.27.1).
All six 64-bit targets, ABI0, at functional parity for scalars (signed/unsigned
ints 1/2/4/8 bytes, pointers, 32/64-bit floats), stack frames + arbitrary TEXT
flags (NewFuncFlags), and SIMD via the Raw escape hatch — SSE2 + AVX2
(amd64), NEON (arm64), RVV (riscv64), LSX + LASX (loong64), VSX
(ppc64le), vector facility (s390x, big-endian), up to 256-bit.
Struct/slice/string aggregates and fixed-size arrays by value are proven
generically in the shared layout model, with dedicated runtime-tested examples
on four targets (amd64, arm64, riscv64, loong64) today. Each architecture
differs only in its move table. A typed vector helper, first-class vector
types, and aggregate/array examples for ppc64le and s390x are the main
remaining items.
- Website (landing): https://go-asmgen.github.io — built with Hugo.
- Documentation: https://go-asmgen.github.io/docs/ — MkDocs Material, versioned with mike; source in go-asmgen/docs.
