summaryrefslogtreecommitdiff
path: root/lib/freebl/gcm-arm32-neon.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2020-01-14 16:20:39 +0000
committerMike Hommey <mh@glandium.org>2020-01-14 16:20:39 +0000
commitebaf120ba8998022d083129e9fc1a2e6a5a5237b (patch)
tree382aaf49be03781fbb84c50a292e3674bd3b1fde /lib/freebl/gcm-arm32-neon.c
parent5e84c809a385e12d20f908eeb21c42feba55ebe0 (diff)
downloadnss-hg-ebaf120ba8998022d083129e9fc1a2e6a5a5237b.tar.gz
Bug 1608327 - Fix freebl arm NEON code use on tier3 platforms. r=jcj
Despite the code having runtime detection of NEON and crypto extensions, the optimized code using those instructions is disabled at build time on platforms where the compiler doesn't enable NEON by default of with the flags it's given for the caller code. In the case of gcm, this goes as far as causing a build error. What is needed is for the optimized code to be enabled in every case, letting the caller code choose whether to use that code based on the existing runtime checks. But this can't be simply done either, because those optimized parts of the code need to be built with NEON enabled, unconditionally, but that is not compatible with platforms using the softfloat ABI. For those, we need to use the softfp ABI, which is compatible. However, the softfp ABI is not compatible with the hardfp ABI, so we also can't unconditionally use the softfp ABI, so we do so only when the compiler targets the softfloat ABI, which confusingly enough is advertized via the `__SOFTFP__` define. Differential Revision: https://phabricator.services.mozilla.com/D59451
Diffstat (limited to 'lib/freebl/gcm-arm32-neon.c')
-rw-r--r--lib/freebl/gcm-arm32-neon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/freebl/gcm-arm32-neon.c b/lib/freebl/gcm-arm32-neon.c
index 97eb82ec6..be0424770 100644
--- a/lib/freebl/gcm-arm32-neon.c
+++ b/lib/freebl/gcm-arm32-neon.c
@@ -11,7 +11,7 @@
#include "secerr.h"
#include "prtypes.h"
-#if defined(__ARM_NEON__) || defined(__ARM_NEON)
+#if defined(IS_LITTLE_ENDIAN)
#include <arm_neon.h>
@@ -199,4 +199,4 @@ gcm_HashZeroX_hw(gcmHashContext *ghash)
return SECSuccess;
}
-#endif /* __ARM_NEON__ || __ARM_NEON */
+#endif /* IS_LITTLE_ENDIAN */