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

Correct MOD_SS_Conv/Mod_UU_Conv behaviour for I8/I16 #114

merged 10 commits into from May 14, 2019


Copy link

commented May 13, 2019

This PR supersedes #112. This is a cleaned up version of PR #112 with consistent history.

We add a testcase bytearraymini which is a simplified version of bytearray which tests I8/I16 -> I64 upcasting.

Unfortunately, we do not have a testcase for the downcast of I64/I32 -> I16/I8, though the code path has been implemented in the same test case.

bollu added 2 commits May 13, 2019

- Update `bytearray` with expected output.
- Add `bytearraymini`, with somewhat lower level / simpler examples
  than bytearray#

Both of these tests exercise the code generation of upcasts: I8/I16 -> I64
with the instructions MO_SS_Conv and MO_UU_Conv.
…owering of I8/I16.

This fixes the bytarray and bytearraymini test cases. We currently only
have test cases which exercise the upcast from I8/I16 -> I64, NOT the
downcast from I64 -> I8/I16. However, the patch implements both, and
*should* be correct.
@TerrorJack TerrorJack merged commit 0f92fec into master May 14, 2019
1 check passed
1 check passed
build Workflow: build
@TerrorJack TerrorJack deleted the may-13-add-support-for-int8-clean-history branch May 14, 2019

This comment has been minimized.

Copy link

commented May 14, 2019

Good job! I did a little bit of more tweaks before merging:

  • Remove the now redundant __asterius_i32_slot, since we always use __asterius_i64_slot anyway.
  • Correct the size of __asterius_i64_slot, which should be 8. Currently, we align all data segments by 16 bytes, so earlier code worked since there are redundant padding bytes. But still good to have a correct size here.
  • The wrap* and extend* functions are now inlined, to save the overhead of wasm function calls.
  • Misc formatting to improve code style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.