Skip to content

winch(x64): Improve ABI support in trampolines#6204

Merged
saulecabrera merged 1 commit into
bytecodealliance:mainfrom
saulecabrera:winch-x64-improve-abi-compatibility
Apr 14, 2023
Merged

winch(x64): Improve ABI support in trampolines#6204
saulecabrera merged 1 commit into
bytecodealliance:mainfrom
saulecabrera:winch-x64-improve-abi-compatibility

Conversation

@saulecabrera
Copy link
Copy Markdown
Member

@saulecabrera saulecabrera commented Apr 12, 2023

Follow up to #6119

This commit improves ABI support in Winch's trampolines mainly by:

  • Adding support for the fastcall calling convention.
  • By storing/restoring callee-saved registers.

One of the explicit goals of this change is to make tests available in the x86_64 target as a whole and remove the need exclude the windows target.

This commit also introduces a CallingConvention enum, to better reflect the subset of calling conventions that are supported by Winch.

@saulecabrera
Copy link
Copy Markdown
Member Author

I'm creating it as a draft, since I want to check for any CI failures first.

@github-actions github-actions Bot added the winch Winch issues or pull requests label Apr 12, 2023
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @saulecabrera

Details This issue or pull request has been labeled: "winch"

Thus the following users have been cc'd because of the following labels:

  • saulecabrera: winch

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@saulecabrera saulecabrera force-pushed the winch-x64-improve-abi-compatibility branch from a337bec to bab709a Compare April 13, 2023 01:31
@saulecabrera saulecabrera requested a review from cfallin April 13, 2023 10:30
@saulecabrera saulecabrera marked this pull request as ready for review April 13, 2023 10:30
@saulecabrera saulecabrera requested review from a team as code owners April 13, 2023 10:30
@saulecabrera saulecabrera requested review from alexcrichton and removed request for a team and alexcrichton April 13, 2023 10:30
@saulecabrera saulecabrera force-pushed the winch-x64-improve-abi-compatibility branch from bab709a to bf15fe5 Compare April 13, 2023 10:55
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me! Given the trickiness of calling conventions though I think it'd be good to get second opinion from @cfallin too though. (I also just now realized that my request-to-review was removed, oops!)

One thing I might recommend is to add a commit with prtest:full in the commit message to run all tests for the PR to include windows/macOS to confirm it all works out

@saulecabrera
Copy link
Copy Markdown
Member Author

One thing I might recommend is to add a commit with prtest:full in the commit message to run all tests for the PR to include windows/macOS to confirm it all works out

Agreed, I had added prtest:full in my initial commit, and removed it once I verified that all the tests pass.

Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

LGTM as well re: ABI details!

Comment thread winch/codegen/src/isa/x64/regs.rs Outdated
Comment thread winch/codegen/src/trampoline.rs Outdated
This commit improves ABI support in Winch's trampolines mainly by:

* Adding support for the `fastcall` calling convention.
* By storing/restoring callee-saved registers.

One of the explicit goals of this change is to make tests available in the x86_64 target
as a whole and remove the need exclude the windows target.

This commit also introduces a `CallingConvention` enum, to better
reflect the subset of calling conventions that are supported by Winch.
@saulecabrera saulecabrera force-pushed the winch-x64-improve-abi-compatibility branch from bf15fe5 to d81a8e7 Compare April 14, 2023 20:55
@saulecabrera saulecabrera added this pull request to the merge queue Apr 14, 2023
Merged via the queue into bytecodealliance:main with commit 9dd0b59 Apr 14, 2023
@saulecabrera saulecabrera deleted the winch-x64-improve-abi-compatibility branch April 14, 2023 21:43
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Apr 16, 2023
This commit improves ABI support in Winch's trampolines mainly by:

* Adding support for the `fastcall` calling convention.
* By storing/restoring callee-saved registers.

One of the explicit goals of this change is to make tests available in the x86_64 target
as a whole and remove the need exclude the windows target.

This commit also introduces a `CallingConvention` enum, to better
reflect the subset of calling conventions that are supported by Winch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

winch Winch issues or pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants