Skip to content

plan9asm: add cross-version instruction coverage and WebAssembly lowering - #2

Closed
cpunion wants to merge 15 commits into
mainfrom
codex/instruction-coverage-20260901
Closed

cpunion wants to merge 15 commits into
mainfrom
codex/instruction-coverage-20260901

Conversation

@cpunion

@cpunion cpunion commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add operand-form and register-pair coverage across supported Plan 9 assembly architectures
  • add official Go WebAssembly Plan 9 assembly parsing, signature inference, LLVM lowering, and executable conformance tests
  • lower the official Go wasm runtime ABI: generated go_asm.h offsets, linear-memory SP/FP frames, CTXT and register globals, caller PC/resume dispatch, CALLNORESUME, and RETUNWIND
  • translate the official internal/bytealg, internal/chacha8rand, internal/runtime/atomic, and runtime wasm assembly without source patches
  • validate Go 1.20 through Go 1.27 GOROOT assembly, ARM GOARM=5/6/7, and ARM64 GOARM64=v8.0
  • reject closure-context and unsupported operand boundaries explicitly instead of silently miscompiling them

WebAssembly scope

The zero-value/direct mode preserves plan9asm's existing LLVM/C-compatible wasm calling convention. The explicit Go ABI mode models the official GOARCH=wasm assembly contract used by GOOS=js and GOOS=wasip1; Emscripten ABI/profile selection remains owned by LLGo.

The Go ABI mode covers both the Go 1.20 write-barrier/import shape and the Go 1.21+ native helper shape. It emits LLVM modules for all selected official standard-library wasm assembly files, including generated struct offsets such as gobuf_g.

The execution fixtures translate real GOROOT internal/bytealg, internal/runtime/atomic, and runtime assembly, compile the generated LLVM IR with llc, link with wasm-ld, and run the module with Node. Whole-runtime corpus validation proves translation and LLVM object generation; LLGo R1 integration additionally proves these packages compile and run without their former source patches under Emscripten wasm32 and Memory64.

Validation

  • go test ./...
  • go test -race ./...
  • LLGo R1 via a temporary go.work, then again through the pinned pseudo-version: all target profiles build, and llgo test passes under Emscripten wasm32 and Memory64
  • Go 1.20 js/wasm official standard-library corpus: 24 asm files, 18 LLVM modules
  • Go 1.21–1.27 js/wasm and wasip1/wasm official standard-library corpora: no unsupported forms or parse failures; every generated module accepted by llc
  • Go 1.27 Linux/macOS/Windows corpus, including 386, amd64, arm64, ARM GOARM=5/6/7, and ARM64 GOARM64=v8.0

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@cpunion cpunion changed the title plan9asm: add operand-form coverage and executable conformance plan9asm: add cross-version instruction coverage and WebAssembly lowering Sep 1, 2026
@cpunion
cpunion changed the base branch from ci-base-xgo-dev-main-20260901 to main September 1, 2026 08:17
@cpunion cpunion closed this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant