forked from wasmi-labs/wasmi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 49347a6
Showing
48 changed files
with
73,337 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
/target/ | ||
**/*.rs.bk | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "parity-wasm-interp" | ||
version = "0.1.0" | ||
authors = ["Sergey Pepyakin <[email protected]>"] | ||
|
||
[dependencies] | ||
# parity-wasm = "0.20" | ||
parity-wasm = { path = "/Users/pepyakin/dev/parity/parity-wasm" } | ||
wabt = "0.1" | ||
byteorder = "1.0" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
;; /// @file accumulate_u8.cpp | ||
;; #include <emscripten.h> // macro EMSCRIPTEN_KEEPALIVE | ||
;; #include <stdint.h> | ||
;; #include <vector> | ||
;; #include <numeric> | ||
;; extern "C" { | ||
;; int32_t EMSCRIPTEN_KEEPALIVE accumulate_u8(const int32_t arlen, const uint8_t *ar) { | ||
;; int32_t arsum = 0; | ||
;; for (int32_t i=0; i<arlen; ++i) | ||
;; arsum += (int32_t) ar[i]; | ||
;; return arsum; | ||
;; } | ||
;; } // extern "C" | ||
(module | ||
(type $0 (func (param i32 i32) (result i32))) | ||
(type $1 (func)) | ||
(import "env" "memoryBase" (global $import$0 i32)) | ||
(import "env" "memory" (memory $0 256)) | ||
(import "env" "table" (table 0 anyfunc)) | ||
(import "env" "tableBase" (global $import$3 i32)) | ||
(global $global$0 (mut i32) (i32.const 0)) | ||
(global $global$1 (mut i32) (i32.const 0)) | ||
(export "__post_instantiate" (func $2)) | ||
(export "_accumulate_u8" (func $0)) | ||
(func $0 (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) | ||
(local $var$2 i32) | ||
(local $var$3 i32) | ||
(block $label$0 (result i32) | ||
(if | ||
(i32.gt_s | ||
(get_local $var$0) | ||
(i32.const 0) | ||
) | ||
(block $label$1 | ||
(set_local $var$2 | ||
(i32.const 0) | ||
) | ||
(set_local $var$3 | ||
(i32.const 0) | ||
) | ||
) | ||
(block $label$2 | ||
(return | ||
(i32.const 0) | ||
) | ||
) | ||
) | ||
(loop $label$3 | ||
(set_local $var$3 | ||
(i32.add | ||
(i32.load8_u | ||
(i32.add | ||
(get_local $var$1) | ||
(get_local $var$2) | ||
) | ||
) | ||
(get_local $var$3) | ||
) | ||
) | ||
(br_if $label$3 | ||
(i32.ne | ||
(tee_local $var$2 | ||
(i32.add | ||
(get_local $var$2) | ||
(i32.const 1) | ||
) | ||
) | ||
(get_local $var$0) | ||
) | ||
) | ||
) | ||
(get_local $var$3) | ||
) | ||
) | ||
(func $1 (type $1) | ||
(nop) | ||
) | ||
(func $2 (type $1) | ||
(block $label$0 | ||
(set_global $global$0 | ||
(get_global $import$0) | ||
) | ||
(set_global $global$1 | ||
(i32.add | ||
(get_global $global$0) | ||
(i32.const 5242880) | ||
) | ||
) | ||
(call $1) | ||
) | ||
) | ||
;; custom section "dylink", size 5 | ||
) | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(module | ||
(type (;0;) (func (result i32))) | ||
(func (;0;) (type 0) (result i32) | ||
i64.const 9223372036854775807 | ||
i64.const -9223372036854775808 | ||
i64.const -1152894205662152753 | ||
i64.const -8192 | ||
i32.const 1024 | ||
i32.const 2048 | ||
i32.const 4096 | ||
i32.const 8192 | ||
i32.const 16384 | ||
i32.const 32767 | ||
i32.const -1024 | ||
i32.const -2048 | ||
i32.const -4096 | ||
i32.const -8192 | ||
i32.const -16384 | ||
i32.const -32768 | ||
i32.const -2147483648 | ||
i32.const 2147483647 | ||
return | ||
) | ||
) |
Binary file not shown.
Oops, something went wrong.