Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiplication and Division in ZKWASM #24

Closed
Tracked by #22
aborg-dev opened this issue Sep 15, 2023 · 1 comment
Closed
Tracked by #22

Support Multiplication and Division in ZKWASM #24

aborg-dev opened this issue Sep 15, 2023 · 1 comment
Assignees

Comments

@aborg-dev
Copy link

aborg-dev commented Sep 15, 2023

Right now Cranelift backend only supports addition and subtraction operations. We want to extend it to support multiplication and division.

An example program would be:

(module
 (import "env" "assert_eq" (func $assert_eq (param i32) (param i32)))
 (func $main
	i32.const 2
	i32.const 3
	i32.mul
	i32.const 6
	call $assert_eq)
 (start $main))

(and another similar one for division)

@MCJOHN974 MCJOHN974 mentioned this issue Sep 19, 2023
@aborg-dev aborg-dev added this to the ZK WASM: Stage 1 milestone Sep 19, 2023
@aborg-dev aborg-dev transferred this issue from near/nearcore Sep 26, 2023
@nagisa
Copy link
Collaborator

nagisa commented Sep 27, 2023

Arbitrary multiplication seems like could be supported with the :ARITH instruction which is actually a add-multiply instruction, but we can always set the add component to zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants