100 Commits
Author SHA1 Message Date
Edoardo Vacchi 2c14bbff3d feat: typed function references spec (#2497)
Add experimental support for the [Typed Function References](https://github.com/WebAssembly/function-references)
proposal.

Closes https://github.com/wazero/wazero/issues/2483, follows up to the
refactoring in https://github.com/wazero/wazero/pull/2495 and prepares
to WasmGC.

Typed function references extend WebAssembly's type system with
non-nullable reference types and concrete function type indices (`(ref
$t)`, `(ref null $t)`), enabling direct calls through typed references
(`call_ref`, `return_call_ref`) and null-aware branching (`br_on_null`,
`br_on_non_null`, `ref.as_non_null`).

Excluding tests and spec suites, the feature amounts to roughly 1,900
lines of code.

Feature flag: `experimental.CoreFeaturesTypedFunctionReferences`

## What's the use for this?

Sadly, very little. This proposal is a pretty much just a prerequisite
for the GC proposal.

On the flip side, it completes the exception handling spec
(https://github.com/wazero/wazero/pull/2489):
1. two EH spec tests were previously skipped because they required
distinguishing nullable from non-nullable references. Those tests now
pass.
2. The fuzzer is now enabled for both exception handling and typed
function references. It could not be enabled for EH because the fuzzer
would generate func refs.

So I guess, technically, it has a use :D

## Type System

`ValueType` (already `uint64` introduced in
https://github.com/wazero/wazero/pull/2495) is now extended with bit
flags to encode nullability and concrete type indices:

| Bits  | Purpose                         |
|-------|---------------------------------|
| 0-7   | Base type byte (same as before) |
| 8     | Non-nullable flag               |
| 9     | Concrete ref flag               |
| 32-63 | Type index (for `(ref $t)`)     |

This encoding should be fine for WasmGC too and should not require
further changes in the near future.

Subtyping rules: non-nullable is a subtype of nullable (same
kind/index); concrete function refs `(ref $t)` are subtypes of
`funcref`.

## New Instructions

| Opcode | Hex | Description |

|-------------------|--------|----------------------------------------------------------|
| `call_ref` | `0x14` | Indirect call through a typed function reference
|
| `return_call_ref` | `0x15` | Tail-call variant of `call_ref` |
| `ref.as_non_null` | `0xd4` | Assert ref is non-null, trap otherwise |
| `br_on_null` | `0xd5` | Branch if null, push non-null ref on
fall-through |
| `br_on_non_null` | `0xd6` | Branch if non-null (carrying the ref),
fall-through on null |

## Validation

Tricky bits:

- Non-nullable local initialization tracking: `local.get` on a
non-nullable ref local is rejected unless a `local.set`/`local.tee` has
been executed in the same or enclosing block scope. State is
saved/restored at block boundaries per the spec (needed an additional
field to keep track of init'd values)
- `ref.func` now pushes `(ref $t)` (the concrete non-nullable type of
the referenced function) onto the validation type stack instead of plain
`funcref`, so that passing it to `call_ref` type-checks without an
upcast.
- Block types, element segments, table types, and const expressions all
support concrete ref types.
- The type section now validates forward references (standalone types
can only reference previously defined types; rec group members can
reference each other).

## Interpreter

The five new opcodes are compiled to new IR operations and executed in
the interpreter loop. `call_ref` / `return_call_ref` load the function
instance from the opaque reference pointer, null-check, and dispatch.
`br_on_null` / `br_on_non_null` pop the reference, check nullity, and
either branch or fall through with the appropriate stack state.

## Compiler (wazevo)

Implemented entirely as SSA-level lowering with no backend-specific
code:

- `call_ref` / `return_call_ref`: load executable and module context
pointers from the function instance, null-check via
`ExitIfTrueWithCode(ExitCodeNullReference)`, then dispatch as an
indirect call.
- `br_on_null` / `br_on_non_null`: compare against zero, branch with
trampoline blocks for try-table exits and listener support.
- `ref.as_non_null`: null-check with trap.

## Binary Decoding

- `decodeRefType` helper extracted and shared across `value.go`,
`element.go`, `table.go`, and `code.go` for consistent handling of `(ref
null ht)` / `(ref ht)` prefixes.
- Tables support the `0x40 0x00` prefix for initializer expressions
(required for non-nullable table element types).
- `DecodeBlockType` handles concrete ref types as block results.

## Cross-Module Linking

`call_indirect` uses `FunctionTypeID` for fast runtime type checks. The
existing `FunctionType.key()` method builds the key from raw `ValueType`
bytes, but with concrete refs `(ref $0)` in module A and `(ref $0)` in
module B may refer to structurally identical types at different local
indices. `structuralTypeKey` fixes this by replacing local type indices
with the already-assigned `FunctionTypeID` of the referenced type, so
two modules with the same structural signature share a single
`FunctionTypeID`.

## Spec Suite

The spec test suite uses `wasm-tools json-from-wast` (same as exception
handling). All 22 test files pass.

## Fuzzing

The fuzzer (`nodiff`) now enables both `CoreFeaturesExceptionHandling`
and `CoreFeaturesTypedFunctionReferences`. Dummy import generation
handles `exnref` and concrete ref types.

---------

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2026-05-28 15:57:29 +02:00
Edoardo Vacchi 475a1f8f0d fix: compilation cache should store catch clause table (EH) (#2498)
In #2489 we did not account for the compilation cache, so the new
`catchClauseTable` was just being silently dropped!

Fixes #2496.

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2026-05-21 09:22:12 +02:00
Edoardo Vacchi a3374cf27a refactor: wasm.ValueType as type definition + widening (uint64) (#2495) 2026-05-11 12:01:15 -07:00
Edoardo Vacchi bfb20e0ba7 feat: exception handling spec (#2489)
Add experimental support to the Exception Handling spec.

Exception handling adds structured error propagation to WebAssembly
through `tags` (typed exception signatures), `throw/throw_ref` (raising
exceptions), and `try_table` (catching exceptions with typed `catch`
clauses). A new value type, `exnref`, represents a reference to a caught
exception.

Excluding tests and spec suites, the entire feature amounts to a little
less than 2000 lines of code.

Feature flag: `experimental.CoreFeaturesExceptionHandling`


## What's the use for this?

In the spirit of always having a real use case for the specs we
implement, I did check this implementation against the one large Wasm
C++ codebase I am aware about, i.e.
https://github.com/klippa-app/go-pdfium, and I verified that the entire
suite, compiled with `emcc+wasm-opt` does work; incidentally, much of
the existing support code, based on Emscripten's longjmp/setjmp, can be
dropped (thx @jerbob92 for the help!)

Broadly speaking, I don't know how much EH-enabled Wasm code you will
find in the wild. For instance, code compiled using Clang's C++ backend
does not really throw new-style exceptions, unless you compile WASI-SDK
with some flags, or you build with `emcc` and translate old-style
exceptions using `wasm-opt` (see exceptions_test.go)

In short, this spec should be really seen as a step towards supporting
the GC spec. The design decisions (esp. regarding the test suite) follow
from this reasoning.


## Spec Suite

`wast2json` **does not** support the EH suite, but `wasm-tools` does,
albeit with a tiny quirk in the way negative numbers are rendered. In
this PR _I am not_ moving the other suites to `wasm-tools` though.

The spec test suite passes entirely, except for two tests that are
intentionally skipped.

These tests assume **a very small subset** of typed references is
implemented; specifically, the distinction between nullable and
non-nullable function references (`(ref null $t)` vs `(ref $t)`). I have
decided to just flatten all non-nullable refs to nullable refs at decode
time, so we cannot detect the type mismatch the spec expects in these
cases.

Passing the **full suite is actually straightforward** because it only
requires introducing a non-nullable variant for each ref type: strictly
speaking the 2 failing tests are only for related nullable vs
non-nullable **func refs** -- so I can special-case these and/or add
non-nullable types for each known value; however, we will **need** to
rethink the representation of Values for the GC proposal anyway (because
this will introduce custom type indices, and these won't fit our
currently byte-sized `ValueType` enum).

The subtype-checking functions (`isRefSubtypeOf`,
`isStrictRefSubtypeOf`) are kept as abstraction points but currently
they are just equalities.

Nevertheless, as proven by the CPP example and
https://github.com/klippa-app/go-pdfium this PR provides a starting
point that is already useful (even if it is for limited cases).


## Interpreter

Exception handling in the interpreter:

**Within a frame**, `try_table` blocks are compiled into a static
exception table with PC ranges. When `throw` or `throw_ref` executes,
`searchExceptionTable` scans backwards (inner handlers first) for a
catch clause whose PC range covers the current instruction. If a match
is found, `applyExceptionHandler` adjusts the operand stack depth and
jumps to the catch target PC directly.

**Across frames**, if no handler is found in the current frame,
`panic(&thrownException{...})` propagates up the Go call stack. Each
cross-function call goes through `callWithUnwind()`, which uses
`defer/recover` to intercept the panic. Its `canRestore` method unwinds
`ce.frames` to the caller's depth and searches that frame's exception
table. If a handler is found, `doRestore` applies it and
`callWithUnwind` returns `true` (frame unwound -- caller refreshes
locals and continues). If not, the panic re-propagates to the next outer
`callWithUnwind`.

Note on the implementation: this mechanism is unified with the existing
`snapshot/restore` API through the `restorable` interface: both
`*thrownException` and `*snapshot` implement `canRestore`/`doRestore`,
so `callWithUnwind` handles both with a single defer/recover path. The
short-circuit check (`len(exceptionTable) == 0 && no snapshotter`) skips
the defer/recover overhead entirely for frames that don't need it.


## Compiler

The compiler could not reuse the snapshot/restore mechanism directly,
but it follows a similar pattern. One cool thing is that exception
handling could be implemented entirely as an SSA-level lowering with new
exit codes; there is no backend-specific code.

Throwing uses a two-phase ABI:

1. `ExitCodeThrowAlloc`: exits to the Go runtime to allocate an
`Exception` struct on the heap and writes a pointer to its params array
into the execution context. Then we return control to compiled code,
which stores the tag parameters directly into the struct.
2. `ExitCodeThrow`: exits to the Go runtime again to search for a
matching handler, restore the stack checkpoint, and branch to the catch
target.

The idea is that we NEED to allocate the parameter slice dynamically, so
we delegate to the Go runtime. Incidentally, this also allows us to
unify `throw` and `throwRef`; in the latter case, we skip the `alloc`
phase, and we exit straight to `ExitCodeThrow`.

### Trampolines

The compiler uses four trampolines to return to host to manage exception
state:

| Trampoline | Exit Code | Purpose |
|---|---|---|
| **ThrowAlloc** | `ExitCodeThrowAlloc` | Allocates an `Exception`
struct on the Go heap, writes `&exn.Params[0]` into `execCtx` so
compiled code can store tag parameters directly. |
| **Throw** | `ExitCodeThrow` | Searches `tryHandlers` for a matching
catch clause, restores the stack checkpoint on match, sets
`caughtExceptionClauseIdx` for the compiled dispatch. Used for both
`throw` (after ThrowAlloc) and `throw_ref` (directly). |
| **TryTableEnter** | `ExitCodeTryTableEnter` | Clones the current stack
as a checkpoint, pushes a `tryHandler` with the catch clause table and
saved module instance. Sets `caughtExceptionClauseIdx = -1` (no
exception). |
| **TryTableLeave** | `ExitCodeTryTableLeave` | Pops the most recent
`tryHandler`. Emitted at `try_table` block ends, and before any branch
or return that exits a `try_table` scope. |

### Lowering

As mentioned earlier, this entirely resolved at the SSA-level. In
particular:

- **Entry**: when a `try_table` is encountered, the compiler emits a
call to the TryTableEnter trampoline. Control returns to compiled code,
which reads `caughtExceptionClauseIdx` from the execution context — if
it's -1 (no exception), execution continues into the `try_table` body.

- **Normal exit**: when execution reaches the `End` opcode of the
`try_table` block, a TryTableLeave trampoline call is emitted.

However, every TryTableEnter must have a matching TryTableLeave on every
control flow path that doesn't throw; so we also "TryTableLeaves" also
for the following:

- **Early exit (branch)**: a `br`, `br_if`, or `br_table` can jump to a
label outside the `try_table`, skipping its `End`.
`emitTryTableLeaves(depth)` walks the control frame stack and emits one
TryTableLeave for each `try_table` frame the branch crosses. For
`br_if`, this happens in a trampoline basic block that only executes on
the taken path.

- **Early exit (return)**: `return`, `return_call`, and
`return_call_indirect` call `emitTryTableLeaves` with the full control
stack depth, popping all active handlers before leaving the frame.

- **Throw**: on `throw`/`throw_ref`, compiled code exits to the dispatch
loop via ExitCodeThrow. `doHandleException` searches `tryHandlers`
innermost-to-outermost. On match, it restores the cloned stack
checkpoint, sets `caughtExceptionClauseIdx`, and re-enters compiled code
at the handler's return address. The compiled dispatch branches to the
matching catch clause's handler block.


### Caveats

- As described above, we are skipping 2 spec tests (will be addressed
when we implement typed references)
- Because of that, I am _not_ enabling by default the fuzzer: I would
have to special-case for typed references and/or TODOs I have left
behind; I did run the fuzzer with some special-casing while debugging
the issue with pdfium (#2488) and did not find issues (the fuzzer did go
frequently OOM though); in fact, the pdfium issue was actually unrelated
(!)

---------

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2026-04-26 09:12:51 -07:00
Edoardo Vacchi 0bcb5f2a8c interpreter: ensure i32 operations are masked (#2488) 2026-04-15 10:48:27 -07:00
Edoardo Vacchi 481bac90d3 feat: tail-call proposal (#2403)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2025-08-23 10:13:13 -07:00
Edoardo Vacchi b35dd5fbea bench: disable TestOpenFileCreateExclDanglingSymlink on Windows (#2416)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2025-08-04 09:22:49 -07:00
Edoardo Vacchi 26d5f5eb4b arm64: account for imported funcs in the branch to a relocation island (#2387)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2025-03-06 08:08:48 -08:00
Edoardo Vacchi fc17301436 bench: skip TestOpenFileDevNull on Windows (#2388)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2025-03-06 08:08:39 -08:00
Edoardo Vacchi 610c202ec4 arm64: account for imported functions when encoding relocation islands (#2346)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-11-23 13:55:22 -08:00
Edoardo Vacchi b468adaf3d compiler: ResolveImportedFunction should infer the typeID from the importing module (#2314)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-09-16 10:59:41 +09:00
Edoardo Vacchi c20cade078 wazevo(frontend): BCE should not propagate the memory address to unsealed blocks (#2164)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-03-27 08:19:41 +09:00
Edoardo Vacchi 1b3f80b6ef ci: always use the same command to upload artifacts (#2153)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-03-12 17:33:10 +09:00
Edoardo Vacchi 472719d8aa ci: do not upload artifacts for pre-releases (#2143) 2024-03-09 15:28:20 +09:00
Edoardo Vacchi b7b54d5967 wazevo(docs): optimizing compiler (#2065)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-03-09 09:39:11 +09:00
Edoardo Vacchi f2c9a986b6 chore: ensure all tinygo binaries have been built with 0.31.1 (#2140)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-03-08 14:57:01 +09:00
Edoardo Vacchi 43c66df44f ci: fix WiX toolset path for release (msi build) (#2132)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-03-07 14:31:54 +09:00
Edoardo Vacchi 1b2fd85012 filecache: add trailing crc to serialized executable code (#2091) 2024-02-25 09:27:43 +09:00
Edoardo Vacchi c1c071ecc4 wasi: fix flaky tests (#2068)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-02-20 07:01:22 +09:00
Edoardo VacchiandTakeshi Yoneda 392dcf732a fuzz: adds unaligned global f32 case (#2040)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-02-11 16:06:20 -08:00
Edoardo VacchiandTakeshi Yoneda c7e8dc28e4 wazevo(amd64): simd f32x4, f64x4 spec tests (#2036)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-02-10 08:45:49 -08:00
Edoardo VacchiandTakeshi Yoneda d46ff8399a wazevo(amd64): simd arith2 spec tests (#2005)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-02-08 12:34:47 -08:00
Edoardo VacchiandTakeshi Yoneda 71e464c670 wazevo(amd64): simd arith spec tests (#2004)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-02-08 12:02:12 -08:00
Edoardo Vacchi 6b6ab92840 wazevo(amd64): simd boolean, bitwise spec tests (#1997)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-02-02 11:43:58 -08:00
Edoardo VacchiandTakeshi Yoneda d289f6c021 wazevo(amd64): float conversion to/from signed/unsigned integers (#1991)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-01-31 13:52:58 -08:00
Edoardo Vacchi ed112cf3a4 wazevo(amd64): bitcast, fpromote, fdemote (#1989)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-31 11:26:01 -08:00
Edoardo Vacchi ddc2655db7 wazevo(amd64): support for copysign (#1976)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-29 16:06:17 -08:00
Edoardo Vacchi b40854f4f5 wazevo(amd64): float rounding, min/max (#1971)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-29 12:53:13 -08:00
Edoardo VacchiandTakeshi Yoneda 3b76d4353d wazevo(amd64): lowering for div/rem (#1960)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-01-27 20:18:56 -08:00
Edoardo VacchiandTakeshi Yoneda bc5917a5c5 wazevo(amd64): lower Fabs, Fneg, Fadd, Fsub, Fdiv, Fmul, Fsqrt (#1965)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-01-26 16:11:50 -08:00
Edoardo Vacchi 16a6ffb129 wazevo(amd64): lowering for popcnt, ctz, clz + cpuid refactor (#1959)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-25 09:19:37 -08:00
Edoardo Vacchi c57a64c73d wazevo(amd64): lowering for more arithmetic operations (#1950)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-24 09:48:44 -08:00
Edoardo Vacchi 5bb171763e wazevo(amd64): amode lowering, delete redundant tests, invalid SSA form (#1948)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-24 08:00:49 -08:00
Edoardo Vacchi aa51c60cfb interpreter: vectors should not be committed to memory if OOB (#1949) 2024-01-24 07:18:23 -08:00
Edoardo Vacchi 70ce93b815 wazevo(amd64): amode lowering (#1940)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-23 13:46:15 -08:00
Edoardo Vacchi ae4494779b wazevo(amd64): Iadd, Isub lowering (#1926)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-22 09:14:16 -08:00
Edoardo VacchiandTakeshi Yoneda 2c97062e3d wazevo(amd64): initial implementation for call (#1924)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2024-01-16 11:02:36 -08:00
Edoardo Vacchi f72796965b wazevo(amd64): encode cmovcc, condcc, setcc, cmpRmiR, xmmRmiReg (#1920)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-15 08:28:12 -08:00
Edoardo Vacchi 0dbc86fe06 wazevo(amd64): encode unaryRmR, not, neg, mulHi, shiftR (#1916)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-14 17:13:31 -08:00
Edoardo Vacchi 498d4b4f72 wasi: sockets, use Conn.Control on Unix, too; align to Windows (#1892)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2024-01-02 08:20:11 -08:00
Edoardo Vacchi 823d573fd2 bench: add stdlib benchmark old vs new compiler (#1878)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-12-20 10:42:24 -08:00
Edoardo Vacchi 10bb61bee8 deps: bump golangci-lint to v1.55.2 (#1879) 2023-12-19 06:55:34 -08:00
Edoardo VacchiandTakeshi Yoneda ebaa5a0ebf ci: run integration tests against the optimizing compiler (linux/arm64) (#1875)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2023-12-15 09:24:07 -08:00
Edoardo Vacchi 9841c5fc04 wazevo: fuzz, fix Fcopysign (#1826)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-11-01 07:36:28 +09:00
Edoardo Vacchi 928fce854f wazevo: fuzz, fix ssa.OpcodeInsertlane (#1825)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-31 23:18:46 +01:00
Edoardo Vacchi ec1844c6fc wazevo: fuzz, fix f64x2.pmin (#1824)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-31 14:27:44 +01:00
Edoardo Vacchi 695b49e94d wazevo: fuzz, fix i16x8.narrow_i32x4_u (#1820)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-29 08:02:08 +08:00
Edoardo Vacchi a5d1b12385 wazevo: fuzz, fix load_splat with offset values > 12 bits (#1817)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-25 17:33:57 +02:00
Edoardo Vacchi e3e5b9942d wazevo: fuzz, select does not return the correct value for vectors (#1814)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-25 17:32:25 +02:00
Edoardo VacchiandTakeshi Yoneda 1748dbcfe8 wazevo: fuzz, fix load_splat (#1810)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2023-10-23 09:17:37 +02:00
Edoardo Vacchi 9264104c0b wazevo: fuzz, fix simd shl, shr, shuffle, vbitselect (#1797) 2023-10-19 07:10:45 +09:00
Edoardo Vacchi 583e8772ec wazevo: fuzz OpcodeVIcmp, OpcodeVFcmp, allTrue (#1793) 2023-10-18 07:09:36 +09:00
Edoardo Vacchi a653c8a8f7 wazevo: add fuzz test cases (#1792)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-17 15:54:37 +09:00
Edoardo Vacchi 66a5be714f fuzz: add --sanitizer=none to Makefile (#1776) 2023-10-13 06:23:45 +09:00
Edoardo Vacchi fd43b6be4c wazevo: passes simd_i16x8_q15mulr_sat_s spec test (#1772)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-12 09:00:21 +09:00
Edoardo Vacchi e3d83bbc7a wazevo: passes simd load/store spec tests (#1766)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-11 08:18:07 +09:00
Edoardo Vacchi de928cd9bf wazevo: passes simd extadd, extmul, dot, linking, int extend, splat spectests (#1761)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-06 08:53:45 +09:00
Edoardo VacchiandTakeshi Yoneda 4d208309cf wazevo: passes simd_lane spectests (#1739)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2023-10-05 09:29:32 +02:00
Edoardo Vacchi c94ecdfca0 wazevo: fix simd bit shift test temp reg usage (#1740)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-10-01 20:23:28 +09:00
Edoardo Vacchi cedfddab06 wazevo: passes simd bit shift spec test (#1738)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-29 13:54:33 +02:00
Edoardo Vacchi b3c8c55a2c wazevo: passes simd f32/f64 trunc + conversions spec tests (#1736) 2023-09-28 17:13:16 +09:00
Edoardo VacchiandTakeshi Yoneda ed85669880 wazevo: passes simd f32/f64 cmp, rounding, pmax+pmin spec tests (#1735)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2023-09-26 08:19:03 +09:00
Edoardo Vacchi 3b8b3fba65 wazevo: passes f32x4, f64x4 vector arithmetic spec tests (#1732)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-24 08:51:07 +09:00
Edoardo Vacchi 22b4577ff3 wazevo: passes simd_cmp spec tests (#1730)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-23 07:04:04 +09:00
Edoardo Vacchi 78e954a529 wazevo: passes simd_boolean spec tests (#1724)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-22 17:50:01 +02:00
Edoardo Vacchi 6c84033c46 wazevo: fix side effect for OpcodeVbitselect (#1717)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-18 21:41:55 +09:00
Edoardo Vacchi 9b261b3aa7 wazevo: passes simd_bitwise spec tests (#1715)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-18 14:07:53 +02:00
Edoardo Vacchi 1a36e12d43 wazevo: passes vec_arith2 spectests (#1712)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-15 06:37:54 +09:00
Edoardo Vacchi 04b07ed74c wazevo: passes simd_i16x8_arith, simd_i32x4_arith, simd_i64x2_arith spec tests (#1698)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-14 07:11:47 +09:00
Edoardo Vacchi ffd75aefd0 wazevo: add nontrapping fp conversions (wasm v2) (#1685)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-09-06 10:58:18 +09:00
Edoardo Vacchi 464b384553 wazevo: passes float_exprs, local_set/tee spectests (#1667)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-08-29 07:35:01 +09:00
Edoardo VacchiandTakeshi Yoneda afd220b33b wazevo: add bitwise ops and, or, xor, rotr, rotl (#1655)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
2023-08-25 07:42:51 +09:00
Edoardo Vacchi a5b30a508c wasi: fix symlink-related issues with path handling (#1648)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-08-24 07:25:55 +09:00
Edoardo Vacchi 68d575a924 wazevo: add bit count instruction Popcnt (#1638)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-08-22 06:59:47 +09:00
Edoardo Vacchi eb11a2caf8 wazevo: adds bit count instructions clz, ctz (#1635)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-08-18 11:18:09 +02:00
Edoardo Vacchi 76dce033d3 Upgrade floor Go version to 1.19 everywhere. (#1622) 2023-08-10 06:09:16 +09:00
Edoardo Vacchi edb7bc2b10 wasi: add more test cases to poll_oneoff, cleanup impl (#1612)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-08-05 15:22:15 +02:00
Edoardo Vacchi d88286ba63 sysfs: restore check for EINTR in poll test, fix Windows tests (#1604)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-31 06:47:47 +08:00
Edoardo Vacchi 023a38349a sysfs: implements PollRead with poll instead of select (#1596)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-28 10:49:17 +02:00
Edoardo Vacchi d5d7ac82f1 docs: update specs.md with sock_* (#1598) 2023-07-28 17:07:35 +09:00
Edoardo Vacchi 1e0c73d569 wasi: nonblocking I/O for sockets and pipes on Windows (#1579)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-19 07:30:06 +08:00
Edoardo Vacchi 1cdb72d431 fs: nonblocking writes should use syscall.Write (#1581)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-17 10:19:27 +02:00
Edoardo Vacchi d3f09bdcff wasi: nonblocking pipes on Windows (#1570)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-10 06:50:26 +08:00
Edoardo Vacchi affca16f15 fs: empty guest path should bind to / (#1565)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-07-07 07:10:01 +08:00
Edoardo Vacchi 9762d5b28d wasi: remove gotip binary (#1543)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-29 10:34:51 +02:00
Edoardo Vacchi 39f2ff23a6 wasi: improve stdin support for nonblocking, fix stdout (#1542)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-29 07:51:23 +08:00
Edoardo Vacchi ea63499005 compiler(arm64): avoid conditional jumps to the trap handler (#1524)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-19 19:18:18 +10:00
Edoardo Vacchi b01ba67fdc wasi: add nonblock_test.go from gotip, fix nonblock read on Unix-like (#1517)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-15 07:08:44 +08:00
Edoardo Vacchi f385873239 compiler(arm64): generate trap exit code once (#1516)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-15 08:35:51 +10:00
Edoardo Vacchi 390437e1fe Revert "wip"
This reverts commit 1588723735.
2023-06-09 15:23:25 +02:00
Edoardo Vacchi 1588723735 wip
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-09 15:21:32 +02:00
Edoardo Vacchi 1d22d264d0 wasi: try to make Test_Nonblock less flaky (#1506)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-06 08:04:39 +10:00
Edoardo Vacchi f2d8461a62 wasi: non-blocking i/o on files on *nix (#1502)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-06-03 07:33:19 +08:00
97d0d70b73 wasi: add support for sockets (#1493)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
Co-authored-by: Achille <achille.roussel@gmail.com>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2023-06-02 20:45:42 +08:00
Edoardo Vacchi e987e69a82 wasi: move Readdir logics from fdReaddirFn to Readdir methods (#1483)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-23 10:18:27 -07:00
Edoardo Vacchi 5da6dff27d wasi: Move ReadDir out of the FileEntry structure. (#1482)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-19 16:03:28 +02:00
Edoardo Vacchi a8b4642ce4 compiler: fix benchmarks in compiler, engine; add to Makefile, update API calls (#1480)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-18 09:30:58 +02:00
Edoardo Vacchi ee7b95554a ci: extend pagefile size on Windows (#1478)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-17 15:11:37 +02:00
Edoardo VacchiandAdrian Cole cb06b7b779 platform: fix minor linting issue (#1471)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2023-05-16 12:06:29 +08:00
Edoardo Vacchi e46e803565 site: fix small mistake in TinyGo doc (#1435)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-04 16:31:39 +02:00