-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
How can I disable sign-extension opcode #19121
Comments
If you're already using Another flag you can try is |
I don't think its enough to pass Instead we rely on the Lines 649 to 653 in a90c5ab
The only way that gets triggered today (IIUC) is if you set you min browser versions to include a browser that doesn't support sign extension. For example, you could pass |
@kripken pointed out that you can use |
I have exactly the same problem and cannot get rid of the opcode 192 (which is part of signext as far as I understand). using "-mcpu=mvp" "-mno-sign-ext" for compile and link options leads to: which outputs still i32.extend8_s and many more. Any more ideas to try? |
Sounds like a bug in |
Sure: https://printess-dev.s3.eu-central-1.amazonaws.com/printess.wasm I added a post build "wasm-opt out/wasm/printess.wasm -o out/wasm/printess.wasm --signext-lowering" now to lower it. |
The problem is that the signext-lowering pass isn't actually disabling the sign extension feature, so it is undone by later optimize-instructions passes due to -O3. I can fix it in Binaryen. |
It looks like we can also fix by ensuring that |
I would consider this a real bug in Binaryen, so I'll fix it either way. Given that, it seems better to keep passing --signext-lowering first so that the lowering can potentially be optimized later. |
It's the same. Is there any news? |
@Alexufo what version of emscripten are you using? Can you share a repro case? Our understanding is that this bug is now fixed. |
@sbc100 oh! It works on 3.1.38! |
Awesome. I guess we can close this issue then? |
Hi I'm currently working on a project which has a custom wasm loader, it does not have support for sign-extension.When I compiled my code to wasm and instantiate with its loader, it showed error message like : invalid opcode 192, which pointed to sign-extension. After some googling I found that I could add -mno-sign-ext to disable sign extension.But when I do, the generated wasm still has opcode like i32.extends_8. My question is , how do I completely disable this family of the opcodes, or at least get a warning about its location. Thank you in advance.
The text was updated successfully, but these errors were encountered: