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

Big Endian Support (using extra acorn AST pass) #13413

Merged
merged 16 commits into from
Mar 9, 2021

Conversation

V-for-Vasili
Copy link
Contributor

@V-for-Vasili V-for-Vasili commented Feb 4, 2021

Related to previous discussion about supporting Big Endian architectures:
#12387
#12780

@welcome
Copy link

welcome bot commented Feb 4, 2021

Thank you for submitting a pull request! If this is your first PR, make sure to add yourself to AUTHORS.

@V-for-Vasili V-for-Vasili marked this pull request as ready for review February 8, 2021 15:00
@V-for-Vasili
Copy link
Contributor Author

V-for-Vasili commented Feb 8, 2021

@kripken @juj please take a look!

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the direction looks good!

Please add a test for this. See for example how unsignPointers is tested in tests/test_other.py.

emcc.py Outdated Show resolved Hide resolved
src/preamble_minimal.js Outdated Show resolved Hide resolved
src/preamble_minimal.js Outdated Show resolved Hide resolved
src/settings.js Outdated Show resolved Hide resolved
tests/code_size/hello_world_wasm.js Outdated Show resolved Hide resolved
src/library_little_endian_heap.js Outdated Show resolved Hide resolved
@V-for-Vasili V-for-Vasili force-pushed the BE-port branch 2 times, most recently from 5f795bc to 841e180 Compare March 2, 2021 19:16
@V-for-Vasili
Copy link
Contributor Author

@kripken Please take a look!

On LE machine with SUPPORT_BIG_ENDIAN=0 it does not cause any additional test failures (over core tests). On LE machine with SUPPORT_BIG_ENDIAN=1 it breaks a few tests that deal with runtime code size.

On BE machine there are still problems, but Emscripten works in most cases (for "wasm0", "wasm1", "wasm2" and "other" test suites approximately 600 out of 700 tests pass).

Base automatically changed from master to main March 8, 2021 23:49
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@kripken kripken enabled auto-merge (squash) March 9, 2021 18:15
@kripken kripken disabled auto-merge March 9, 2021 21:56
@kripken
Copy link
Member

kripken commented Mar 9, 2021

Looks like all the test failures here are unrelated issues on main atm, landing.

@kripken kripken merged commit 03b33ac into emscripten-core:main Mar 9, 2021
}
case 'HEAPF64': {
// change "name[idx]" to "LE_HEAP_LOAD_F64(idx*8)"
makeCallExpression(node, 'LE_HEAP_LOAD_F64', [multiply(idx, 8)]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work overall!

Instead of doing the multiplies here, I would recommend placing the multiplies inside the LE_HEAP_LOAD_ and LE_HEAP_STORE_ functions for a nice code size win. (only one multiply per function versus once for each call) - unless there is some reason they need to be here?

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

Successfully merging this pull request may close these issues.

3 participants