Skip to content

Commit

Permalink
Allow static detection of NEON on non-Android ARMv7 targets.
Browse files Browse the repository at this point in the history
This should allow armv7-apple-ios targets to use NEON without any
runtime checks.
  • Loading branch information
briansmith committed Jan 25, 2017
1 parent 9d6981f commit be172b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/openssl/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ OPENSSL_EXPORT char GFp_is_NEON_capable_at_runtime(void);
/* GFp_is_NEON_capable returns true if the current CPU has a NEON unit. If
* this is known statically then it returns one immediately. */
static inline int GFp_is_NEON_capable(void) {
/* Only statically skip the runtime lookup on aarch64. On arm, one CPU is
* known to have a broken NEON unit which is known to fail with on some
* hand-written NEON assembly. For now, continue to apply the workaround even
* when the compiler is instructed to freely emit NEON code. See
* https://crbug.com/341598 and https://crbug.com/606629. */
#if defined(__ARM_NEON__) && !defined(OPENSSL_ARM)
/* On 32-bit ARM, one CPU is known to have a broken NEON unit which is known
* to fail with on some hand-written NEON assembly. Assume that non-Android
* applications will not use that buggy CPU but still support Android users
* that do, even when the compiler is instructed to freely emit NEON code.
* See https://crbug.com/341598 and https://crbug.com/606629. */
#if defined(__ARM_NEON__) && (!defined(OPENSSL_ARM) || !defined(__ANDROID__))
return 1;
#else
return GFp_is_NEON_capable_at_runtime();
Expand Down

0 comments on commit be172b1

Please sign in to comment.