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

Fix floating point calling convention for DynamicFunc trampolines. #1271

Closed
wants to merge 4 commits into from

Conversation

losfair
Copy link
Contributor

@losfair losfair commented Mar 5, 2020

  • Allocate GPR/XMM registers according to on argument types in runtime-core/trampoline_x64.
  • Previously singlepass used GPR for all arguments. Needs to be fixed.

@Hywan Hywan added bug Something isn't working 📦 lib-deprecated About the deprecated crates labels Mar 6, 2020
bors bot added a commit that referenced this pull request Mar 12, 2020
1283: Workaround for floating point arguments and return values in `DynamicFunc`s. r=syrusakbary a=losfair

This PR makes floating point arguments and return values for `DynamicFunc`s work correctly in all three backends.

Previously Singlepass used integer registers for all arguments. This PR adds another thin trampoline layer just before control is transferred to the import function, so that arguments will be rearranged strictly according to the System V ABI.

The full fix would require singlepass to implement the SysV calling convention internally too: #1271 . This is just a workaround.

Co-authored-by: Ivan Enderlin <[email protected]>
Co-authored-by: losfair <[email protected]>
Co-authored-by: Heyang Zhou <[email protected]>
Co-authored-by: Syrus Akbary <[email protected]>
@syrusakbary
Copy link
Member

I believe this is fixed in wasmer master thanks to reborn. I'll close the PR for now.
Could you confirm that's the case @losfair ?

Thanks!

@epilys epilys deleted the fix/dynamicfunc-sysv-fp branch May 4, 2022 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-deprecated About the deprecated crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants