-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Better support for MSVC aarch64 aka ARM64 and ARM64EC #8044
Conversation
0fdad89
to
35f9550
Compare
Rebase & tidy-up |
35f9550
to
26c0305
Compare
26c0305
to
11d8b81
Compare
@@ -74,6 +74,10 @@ | |||
#define MBEDTLS_ARCH_IS_X86 | |||
#endif | |||
|
|||
#if defined(_M_ARM64) || defined(_M_ARM64EC) | |||
#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be careful gating any asm()
blocks on this, as the ABI is different, and certain AArch64 registers cannot be used, as they are not saved during context switches - see "blocked registers" at https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi
ARM64 intrinsics should be supported, see: https://techcommunity.microsoft.com/t5/windows-os-platform-blog/getting-to-know-arm64ec-defines-and-intrinsic-functions/ba-p/2957235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have any MSVS asm - this would only affect MSVS-with-clang (which I would expect is probably not working anyway)
bae6657
to
15a8569
Compare
Given that this could potentially be de-stabilising for Windows-on-Arm, I propose to try and get this in straight after 3.5. |
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
…sion Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
1b58b46
to
3e52184
Compare
@tom-cosgrove-arm WDYT? |
Sorry, this dropped off my review list. Will get back to it now! |
That's fine, it was never an urgent one. My question was more, do you agree this is something we want, and is this the right time to merge given limited ability to test? |
@yuhaoth would you be able to review this? |
Yes, and yes. Regarding "limited ability to test" the longer between code going in and release, the likelier that any issues will be found before release, either by the team or externally |
Signed-off-by: Dave Rodgman <[email protected]>
@yuhaoth could you TAL at this one please? |
@tom-cosgrove-arm @yuhaoth given that we want to get this in early, PTAL |
Just found it . It looks good to me . But it just got conflict |
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
Signed-off-by: Dave Rodgman <[email protected]>
31ec020
to
059f66c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \ | ||
(defined(_M_ARM64) || defined(_M_ARM64EC)) | ||
#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64 | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the time being, it is Okay.
But I think we should introduce target os macros in future. after that it should be
#if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \ | |
(defined(_M_ARM64) || defined(_M_ARM64EC)) | |
#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64 | |
#endif | |
#if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \ | |
(defined(MBEDTLS_ARCH_IS_ARM64) && defined(MBEDTLS_OS_IS_WINDOWS)) | |
#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64 | |
#endif |
Description
Enable NEON and unaligned accesses on ARM64 and ARM64EC.
Note: testing has been pretty limited.
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")