-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add custom dependencies to
Executor
resolver,
Temporarily switch to `from_u32_unchecked` to use `bitcast` and avoid checks.
- Loading branch information
Showing
17 changed files
with
371 additions
and
247 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
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
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
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 |
---|---|---|
|
@@ -3,7 +3,10 @@ | |
extern crate alloc; | ||
use alloc::vec::Vec; | ||
|
||
use crate::intrinsics::{Felt, Word}; | ||
use crate::{ | ||
felt, | ||
intrinsics::{Felt, Word}, | ||
}; | ||
|
||
#[link(wasm_import_module = "miden:core-import/[email protected]")] | ||
extern "C" { | ||
|
@@ -96,7 +99,7 @@ pub fn pipe_double_words_to_memory(num_words: Felt) -> (Word, Vec<Felt>) { | |
let end_ptr = unsafe { write_ptr.add(num_words_in_felts) }; | ||
// Place for returned C, B, A, write_ptr | ||
let mut ret_area = ::core::mem::MaybeUninit::<Result>::uninit(); | ||
let zero = Felt::from_u64_unchecked(0); | ||
let zero = felt!(0); | ||
unsafe { | ||
extern_pipe_double_words_to_memory( | ||
zero, | ||
|
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 |
---|---|---|
|
@@ -409,16 +409,7 @@ end | |
|
||
|
||
export."miden:cross-ctx-account/[email protected]#process-felt" | ||
exec."wit_bindgen_rt::run_ctors_once" | ||
push.0.1 | ||
dup.1 | ||
dup.1 | ||
push.4294967295.1 | ||
exec.::std::math::u64::lt | ||
assert | ||
mul.4294967296 | ||
add | ||
add | ||
exec."wit_bindgen_rt::run_ctors_once" push.3 add | ||
end | ||
|
||
|
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 |
---|---|---|
|
@@ -17,21 +17,21 @@ | |
(instance | ||
(type (;0;) (func (param "a" float32) (param "b" float32) (result float32))) | ||
(export (;0;) "add" (func (type 0))) | ||
(type (;1;) (func (param "a" u64) (result float32))) | ||
(export (;1;) "from-u64-unchecked" (func (type 1))) | ||
(type (;1;) (func (param "a" u32) (result float32))) | ||
(export (;1;) "from-u32-unchecked" (func (type 1))) | ||
) | ||
) | ||
(import "miden:core-import/[email protected]" (instance (;2;) (type 2))) | ||
(core module (;0;) | ||
(type (;0;) (func (param i64) (result f32))) | ||
(type (;0;) (func (param i32) (result f32))) | ||
(type (;1;) (func (param f32 f32) (result f32))) | ||
(type (;2;) (func (result i32))) | ||
(type (;3;) (func)) | ||
(type (;4;) (func (param i32 i32) (result i32))) | ||
(type (;5;) (func (param i32 i32 i32 i32) (result i32))) | ||
(type (;6;) (func (param f32) (result f32))) | ||
(type (;7;) (func (param i32 i32 i32) (result i32))) | ||
(import "miden:core-import/[email protected]" "from-u64-unchecked" (func $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked (;0;) (type 0))) | ||
(import "miden:core-import/[email protected]" "from-u32-unchecked" (func $miden_stdlib_sys::intrinsics::felt::extern_from_u32_unchecked (;0;) (type 0))) | ||
(import "miden:core-import/[email protected]" "add" (func $miden_stdlib_sys::intrinsics::felt::extern_add (;1;) (type 1))) | ||
(import "miden:core-import/[email protected]" "heap-base" (func $miden_sdk_alloc::heap_base (;2;) (type 2))) | ||
(func $__wasm_call_ctors (;3;) (type 3)) | ||
|
@@ -66,8 +66,8 @@ | |
(func $miden:cross-ctx-account/[email protected]#process-felt (;7;) (type 6) (param f32) (result f32) | ||
call $wit_bindgen_rt::run_ctors_once | ||
local.get 0 | ||
i64.const 1 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked | ||
i32.const 3 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u32_unchecked | ||
call $miden_stdlib_sys::intrinsics::felt::extern_add | ||
) | ||
(func $cabi_realloc_wit_bindgen_0_28_0 (;8;) (type 5) (param i32 i32 i32 i32) (result i32) | ||
|
@@ -206,11 +206,11 @@ | |
) | ||
(alias export 2 "add" (func (;0;))) | ||
(core func (;0;) (canon lower (func 0))) | ||
(alias export 2 "from-u64-unchecked" (func (;1;))) | ||
(alias export 2 "from-u32-unchecked" (func (;1;))) | ||
(core func (;1;) (canon lower (func 1))) | ||
(core instance (;0;) | ||
(export "add" (func 0)) | ||
(export "from-u64-unchecked" (func 1)) | ||
(export "from-u32-unchecked" (func 1)) | ||
) | ||
(alias export 1 "heap-base" (func (;2;))) | ||
(core func (;2;) (canon lower (func 2))) | ||
|
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 |
---|---|---|
|
@@ -411,23 +411,9 @@ end | |
|
||
export."miden:base/[email protected]#note-script" | ||
exec."wit_bindgen_rt::run_ctors_once" | ||
push.0.7 | ||
dup.1 | ||
dup.1 | ||
push.4294967295.1 | ||
exec.::std::math::u64::lt | ||
assert | ||
mul.4294967296 | ||
add | ||
push.7 | ||
exec.::miden:cross-ctx-account/[email protected]::"process-felt" | ||
push.0.10 | ||
dup.1 | ||
dup.1 | ||
push.4294967295.1 | ||
exec.::std::math::u64::lt | ||
assert | ||
mul.4294967296 | ||
add | ||
push.10 | ||
assert_eq | ||
end | ||
|
||
|
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 |
---|---|---|
|
@@ -25,23 +25,23 @@ | |
(import "miden:core-import/[email protected]" (instance (;2;) (type 3))) | ||
(type (;4;) | ||
(instance | ||
(type (;0;) (func (param "a" u64) (result float32))) | ||
(export (;0;) "from-u64-unchecked" (func (type 0))) | ||
(type (;0;) (func (param "a" u32) (result float32))) | ||
(export (;0;) "from-u32-unchecked" (func (type 0))) | ||
(type (;1;) (func (param "a" float32) (param "b" float32))) | ||
(export (;1;) "assert-eq" (func (type 1))) | ||
) | ||
) | ||
(import "miden:core-import/[email protected]" (instance (;3;) (type 4))) | ||
(core module (;0;) | ||
(type (;0;) (func (param i64) (result f32))) | ||
(type (;0;) (func (param i32) (result f32))) | ||
(type (;1;) (func (param f32) (result f32))) | ||
(type (;2;) (func (param f32 f32))) | ||
(type (;3;) (func (result i32))) | ||
(type (;4;) (func)) | ||
(type (;5;) (func (param i32 i32) (result i32))) | ||
(type (;6;) (func (param i32 i32 i32 i32) (result i32))) | ||
(type (;7;) (func (param i32 i32 i32) (result i32))) | ||
(import "miden:core-import/[email protected]" "from-u64-unchecked" (func $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked (;0;) (type 0))) | ||
(import "miden:core-import/[email protected]" "from-u32-unchecked" (func $miden_stdlib_sys::intrinsics::felt::extern_from_u32_unchecked (;0;) (type 0))) | ||
(import "miden:cross-ctx-account/[email protected]" "process-felt" (func $cross_ctx_note::bindings::miden::cross_ctx_account::foo::process_felt::wit_import (;1;) (type 1))) | ||
(import "miden:core-import/[email protected]" "assert-eq" (func $miden_stdlib_sys::intrinsics::felt::extern_assert_eq (;2;) (type 2))) | ||
(import "miden:core-import/[email protected]" "heap-base" (func $miden_sdk_alloc::heap_base (;3;) (type 3))) | ||
|
@@ -76,11 +76,11 @@ | |
) | ||
(func $miden:base/[email protected]#note-script (;8;) (type 4) | ||
call $wit_bindgen_rt::run_ctors_once | ||
i64.const 7 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked | ||
i32.const 7 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u32_unchecked | ||
call $cross_ctx_note::bindings::miden::cross_ctx_account::foo::process_felt::wit_import | ||
i64.const 10 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked | ||
i32.const 10 | ||
call $miden_stdlib_sys::intrinsics::felt::extern_from_u32_unchecked | ||
call $miden_stdlib_sys::intrinsics::felt::extern_assert_eq | ||
) | ||
(func $cabi_realloc_wit_bindgen_0_28_0 (;9;) (type 6) (param i32 i32 i32 i32) (result i32) | ||
|
@@ -217,12 +217,12 @@ | |
(elem (;0;) (i32.const 1) func $cross_ctx_note::bindings::__link_custom_section_describing_imports $cabi_realloc) | ||
(data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00") | ||
) | ||
(alias export 3 "from-u64-unchecked" (func (;0;))) | ||
(alias export 3 "from-u32-unchecked" (func (;0;))) | ||
(core func (;0;) (canon lower (func 0))) | ||
(alias export 3 "assert-eq" (func (;1;))) | ||
(core func (;1;) (canon lower (func 1))) | ||
(core instance (;0;) | ||
(export "from-u64-unchecked" (func 0)) | ||
(export "from-u32-unchecked" (func 0)) | ||
(export "assert-eq" (func 1)) | ||
) | ||
(alias export 1 "process-felt" (func (;2;))) | ||
|
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
Oops, something went wrong.