-
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
Disable p256-m asm on aarch64 #8126
Disable p256-m asm on aarch64 #8126
Conversation
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
*/ | ||
#if defined(__GNUC__) &&\ | ||
defined(__ARM_ARCH) && __ARM_ARCH >= 6 && defined(__ARM_ARCH_PROFILE) && \ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ && \ |
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.
Do we know why this uses ASCII values rather than 'M'
and 'A'
directly?
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 was wondering. I guess it has the theoretical advantage of working on non-ASCII systems, but I don't think there's any non-ASCII systemwhere __ARM_ARCH
is defined.
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
@mpg you may want to bring this fix into the upstream project? |
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(__GNUC__) &&\ | ||
defined(__ARM_ARCH) && __ARM_ARCH >= 6 && defined(__ARM_ARCH_PROFILE) && \ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ && \ | ||
!defined(__aarch64__) |
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.
On a related note, I think we should make MUL64_IS_CONSTANT_TIME
default on or forced on on 64-bit architectures (defined by ULONG_MAX >= UINT64_MAX
, I guess). But this doesn't have to be done now, and it's filed in my list of non-critical improvements which I'll submit as part of my review of p256-m.
*/ | ||
#if defined(__GNUC__) &&\ | ||
defined(__ARM_ARCH) && __ARM_ARCH >= 6 && defined(__ARM_ARCH_PROFILE) && \ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ | ||
( __ARM_ARCH_PROFILE == 77 || __ARM_ARCH_PROFILE == 65 ) /* 'M' or 'A' */ && \ |
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 was wondering. I guess it has the theoretical advantage of working on non-ASCII systems, but I don't think there's any non-ASCII systemwhere __ARM_ARCH
is defined.
Description
The optimised assembly in p256-m does not support aarch64. With this PR, it compiles cleanly for Thumb 1, Thumb 2, arm and aarch64 (tested with
mtest MBEDTLS_P256M_EXAMPLE_DRIVER_ENABLED thumb1 thumb2 arm aarch64 clang gcc
).PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")