Add float64 support for wasm32 selfhost#66
Conversation
a6e2bb6 to
fa3da95
Compare
Greptile SummaryThis PR adds the first end-to-end Key changes:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant FE as Frontend
participant IR as IR Layer
participant BE as Wasm32 Backend
participant W as Wasm Emitter
FE->>IR: NFloatLit to OP_CONST_F64 with literal string
FE->>IR: IRLocal.IsFloat64 = true for float64 vars
FE->>IR: IRFunc.ResultKinds with TY_FLOAT64 for float64 returns
IR-->>BE: IRFunc with f64-typed locals and results
BE->>BE: compileFunc assigns tempLocalF64 and localF64 map
BE->>W: f64ConstBits using parseFloatLiteralBits
BE->>W: f64Load or f64Store for local and global get/set
BE->>BE: compileIfaceBox uses 12-byte box for f64 values
W-->>BE: f64.store at offset 4 in box
BE->>BE: compileIfaceCall loads recv via f64Load when recvType is F64
BE->>BE: compileReturn saves and reloads via scratch with i times 8 stride
BE->>W: emit f64.add, f64.eq, f64.convert and related ops
|
Summary
float64path through the frontend, IR, andwasi/wasm32backendselfhost-wasmfixed-point convergence and drop the stale wasm fullcompiler skiptmp/andweb/*-library.jsscratch outputs in the repo root.gitignoreValidation
./build/build build./build/build selfhost-wasm./build/rtg -strict -T wasi/wasm32 ... && wasmtime ...repros for:Notes
test-fullcompiler-wasmgets past the earlieriface_typeassertblocker, but there is still unrelated existing coverage failing later in55_stdlib_additions_extended(strconv.ParseIntsigned behavior)