• v0.1.0 d5a4a6de45

    v0.1.0 Stable

    petrbalvin released this 2026-07-06 07:49:50 +00:00 | 279 commits to main since this release

    Initial release — the Phase 1 foundation.

    Added

    • token, lexer, ast, parser: a hand-written, error-tolerant front end
      for Plan 9 assembly. The lexer splices C-preprocessor line continuations
      (\ before a newline) so multi-line #define macros parse as one opaque
      directive. Validated against the production AVX2/AVX-512 kernels in
      go-libraries/go-flac and the Go runtime's src/runtime/*.s for all four
      architectures, with zero parse errors.
    • arch: register files and complete instruction tables for amd64,
      arm64, riscv64 and loong64, with the middle-dot symbol separator and static
      (<>) symbols. Instruction names are generated from the Go toolchain's own
      assembler source (just gen) — the anames opcode lists plus the common
      opcodes and the per-architecture front-end aliases (arm64 B/BL, the
      .P/.W addressing suffixes, loong64 JAL, the x86 conditional-jump
      spellings) — so every mnemonic the real assembler accepts is recognised.
    • lint: conservative rules — unknown-instruction, operand-count,
      undefined-label, duplicate-label, missing-ret,
      missing-textflag-include, abi-argsize and unreachable-code. Macro
      invocations are recognised (in-file #define names and underscore
      identifiers) and the label/RET heuristics are suppressed in macro-using
      files. abi-argsize parses the // func signature with the Go parser and
      checks the declared TEXT argument size against Go's ABI0 layout;
      unreachable-code flags dead code after RET, suppressed where reachability
      is undecidable (PC-relative jumps, register-indirect branches, #ifdef).
      Register liveness is computed by dataflow over the control-flow graph (basic
      blocks, def/use, iterative backward iteration) and drives register-clobber,
      an audit that flags a callee-saved register written but never saved/restored.
      funcdata-pcdata validates the structure of FUNCDATA/PCDATA directives.
      Zero error-severity diagnostics across the 90-file Go runtime corpus and the
      production go-flac kernels (the register-clobber audit additionally reports
      the go-flac kernels' unsaved callee-saved register use for review).
    • format: an idempotent canonical formatter (operand spacing and per-function
      mnemonic alignment) that preserves comments and round-trips through the
      parser.
    • lsp: a Language Server Protocol server over stdio providing completion,
      hover documentation, document symbols, publish-diagnostics and semantic-token
      highlighting.
    • asm: a standalone amd64 (x86-64) assembler — an instruction encoder (REX/
      ModR-M/SIB/displacement/immediate plus the scalar instruction set, and VEX/
      AVX2 SIMD across three operand forms — NDS, reg/rm and immediate-shift —
      covering the bulk of the integer SIMD set) validated by round-trip decoding
      against golang.org/x/arch, and an assembler that drives the parser's AST
      into the encoder with local-label resolution and FP/SP frame mapping
      (plus Go prologue/epilogue generation), producing output byte-identical to the
      Go assembler for the supported operand forms.
    • cmd/gasm: the gasm binary with tokens, parse, fmt, lint, asm
      and lsp subcommands.
    • _gen: the generator that rebuilds the architecture instruction tables from
      the Go toolchain source (just gen).
    Downloads