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

wasm2kotlin throws unimplemented #4

Open
walksanatora opened this issue Nov 7, 2023 · 2 comments
Open

wasm2kotlin throws unimplemented #4

walksanatora opened this issue Nov 7, 2023 · 2 comments

Comments

@walksanatora
Copy link
Collaborator

walksanatora commented Nov 7, 2023

wasm2kotlin gets to generating

fun w2k_memcpy(w2k_p0: Int, w2k_p1: Int, w2k_p2: Int): Int{
    var w2k_p0 = w2k_p0;
    var w2k_p1 = w2k_p1;
    var w2k_p2 = w2k_p2;
    var w2k_l3: Int = 0
    var w2k_l4: Int = 0
    var w2k_l5: Int = 0
    var w2k_l6: Int = 0
    try {
unimplemented: ...
fish: Job 1, '~/git/wasm2kotlin/build/wasm2ko…' terminated by signal SIGABRT (Abort)

if i check the wasm text of the file the top of that text file is

  (func $memcpy (type 0) (param i32 i32 i32) (result i32)
    (local i32 i32 i32 i32)
    block  ;; label = @1
      block  ;; label = @2
        block  ;; label = @3
          local.get 2
          i32.const 32
          i32.gt_u
          br_if 0 (;@3;)

the function when generated from wasm2c is

static u32 w2c_memcpy(Z__instance_t* instance, u32 w2c_p0, u32 w2c_p1, u32 w2c_p2) {
 u32 w2c_l3 = 0, w2c_l4 = 0, w2c_l5 = 0, w2c_l6 = 0;
 FUNC_PROLOGUE;
 u32 w2c_i0, w2c_i1, w2c_i2;
 u64 w2c_j1;
 w2c_i0 = w2c_p2;
 w2c_i1 = 32u;
 w2c_i0 = w2c_i0 > w2c_i1;
 if (w2c_i0) {goto w2c_B2;}

could it be that br_if is not implemented
or could it be that the (local i32 i32 i32 i32) is not yet understood by wasm2kotlin

@SoniEx2
Copy link
Owner

SoniEx2 commented Jan 14, 2024

is this still an issue? we believe this has been implemented in 19a6c5e ?

@walksanatora
Copy link
Collaborator Author

time to check

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

2 participants