Commit Graph

9 Commits

Author SHA1 Message Date
Crypt Keeper
1cbb496c26 Stops using "ex." to abbreviate "for example" (#827)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-10-24 11:51:48 +09:00
Takeshi Yoneda
303b14e67c moremath: align NaN handling with amd64/arm64 compilers (#705)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-07-21 12:03:05 +09:00
Takeshi Yoneda
29e1dead13 spectest: precise assertion on (canonical,arithmetic) NaNs (#664)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-06-28 20:47:02 +09:00
Anuraag Agrawal
5ed31d3c49 Adds tests for sign bit preservation for moremath rounding functions. (#590)
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-05-23 18:23:26 +09:00
Crypt Keeper
ce1052a097 Isolates testify to one file, so that it is easier to remove (#460)
This starts the process of removing all dependencies from wazero, by
isolating all assertions we use into a single file. This allows us to
port those assertions as we have time, and when twitchy is gone, the
project literally has no dependencies except go!

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-04-14 10:05:38 +08:00
Crypt Keeper
3411795ac7 Adds wasm.Store API to get exported module and host functions (#266)
This adds this interface `wasm.Store` which gives access to functions in
a store without leaking an API to change the store. This is primarily to
support configuration use cases where post-initialization, there's no
need or desire to mutate the store. This also backfills codecs needed to
handle float results.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-02-21 13:49:00 +08:00
Takeshi Yoneda
fbe153bb2c jit(arm64): various float instructions (#257)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-02-18 14:05:24 +09:00
Takeshi Yoneda
43b40e4884 doc: fix drifts (#256)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-02-17 20:11:02 +09:00
Crypt Keeper
5180d2d9c3 Refactors out public API from internals (#238)
This moves to a new end-user API under the root package `wazero`. This
simplifies call sites while hardening function calls to their known
return value. Most importantly, this moves most logic internal, as
noted in the RATIONALE.md.

Ex.

```go
	// Read WebAssembly binary containing an exported "fac" function.
	source, _ := os.ReadFile("./tests/engine/testdata/fac.wasm")

	// Decode the binary as WebAssembly module.
	mod, _ := wazero.DecodeModuleBinary(source)

	// Initialize the execution environment called "store" with Interpreter-based engine.
	store := wazero.NewStore()

	// Instantiate the module, which returns its exported functions
	functions, _ := store.Instantiate(mod)

	// Get the factorial function
	fac, _ := functions.GetFunctionI64Return("fac")

	// Discover 7! is 5040
	fmt.Println(fac(context.Background(), 7))

```

PS I changed the README to factorial because the wat version of
fibonacci is not consistent with the TinyGo one!

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takaya Saeki <takaya@tetrate.io>
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-02-17 17:39:28 +08:00