Skip to content

Add support for WIN ARM64 #1092

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

Merged
merged 10 commits into from
Mar 19, 2024
Merged

Add support for WIN ARM64 #1092

merged 10 commits into from
Mar 19, 2024

Conversation

alfred2g
Copy link
Contributor

Add support for ARM64 on Windows

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.10%. Comparing base (7f55a9c) to head (a01eaba).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1092      +/-   ##
==========================================
- Coverage   83.23%   83.10%   -0.13%     
==========================================
  Files          56       56              
  Lines        5808     5766      -42     
==========================================
- Hits         4834     4792      -42     
  Misses        974      974              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@bretambrose bretambrose left a comment

Choose a reason for hiding this comment

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

Ship it, given Donlan's approval

Copy link
Contributor

@bdonlan bdonlan left a comment

Choose a reason for hiding this comment

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

At first glance, this looks correct... but I'm not an expert in the arm64 memory model. How have we tested this for correctness?

@@ -71,6 +89,32 @@ typedef long aws_atomic_impl_int_t;
typedef long long aws_atomic_impl_int_t;
#endif

#ifdef _M_ARM64
/* Hardware Read Write barrier, prevents all memory operations to cross the barrier in both directions */
# define AWS_RW_BARRIER() __dmb(_ARM64_BARRIER_SY)
Copy link
Contributor

Choose a reason for hiding this comment

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

These are new (seemingly) public symbols, which are only defined on MSVC... should we namespace them to make it clear they are internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am undefining them at the bottom of the file, so they should be OK in term of external symbol visibility

* Volatile ops may or may not imply this barrier, depending on the /volatile: switch, but adding an extra
* barrier doesn't hurt.
*/
# define AWS_SW_BARRIER() _ReadWriteBarrier(); /* software barrier */
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need a #define?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed, but i thought it looks better
but i can remove it and replace it

@alfred2g
Copy link
Contributor Author

alfred2g commented Mar 6, 2024

At first glance, this looks correct... but I'm not an expert in the arm64 memory model. How have we tested this for correctness?

@bdonlan,
We already have race test cases to test for value coherence, and indeed one failed without the changes..
if you have suggestions for a new testcase we can implement, it would be great

@alfred2g alfred2g requested a review from JonathanHenson March 13, 2024 17:43
Copy link
Contributor

@JonathanHenson JonathanHenson left a comment

Choose a reason for hiding this comment

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

Looks good to me. While we're doing arm architecture work. i have a branch of aws-c-common that adds feature detection on windows for arm cpu features such as crc and pmull. Should we add that here?

@alfred2g alfred2g merged commit 2fd6652 into main Mar 19, 2024
@alfred2g alfred2g deleted the arm64_support branch March 19, 2024 20:35
@teo-tsirpanis teo-tsirpanis mentioned this pull request Apr 2, 2025
2 tasks
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.

6 participants