Skip to content

Conversation

@compnerd
Copy link
Member

@compnerd compnerd commented Nov 4, 2025

This fixes register information handling for the preserve_most and preserve_all calling conventions on Windows ARM64.

The root issue was cascading if statements whose behavior depended on their order. This patch makes the minimal, tactical change needed for Swift’s two calling conventions, unblocking current work. A broader refactor to remove the ordering dependency is still desired and will follow in a subsequent PR.

(cherry picked from commit 8cd2244)

…166436)

This fixes register information handling for the `preserve_most` and
`preserve_all` calling conventions on Windows ARM64.

The root issue was cascading `if` statements whose behavior depended on
their order. This patch makes the minimal, tactical change needed for
Swift’s two calling conventions, unblocking current work. A broader
refactor to remove the ordering dependency is still desired and will
follow in a subsequent PR.

(cherry picked from commit 8cd2244)
@compnerd
Copy link
Member Author

compnerd commented Nov 4, 2025

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Nov 5, 2025

@swift-ci please test Windows platform

Correct a typo in the triple that is used for the test. Because the OS
was not recognised, it would fall to the non-Windows code generation.

(cherry picked from commit 66f52ca)
When lowering code for Windows, we might be using a non-standard calling
convention (e.g. `preserve_most`). In such a case, we might be spilling
registers which are unexpected (i.e. x9-x15). Use the ARM64EC opcodes to
indicate such spills.

This adds support for the handling for these spills but is insufficient
on its own. The encoded results are incorrect due to the expectation
that the pair wise spills are always 16-byte aligned which we currently
do not enforce. Fixing that is beyond the scope of emitting the SEH
directives for the spill.

(cherry picked from commit 77b9301)
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.

1 participant