summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2018-11-03 00:46:06 +0100
committerJames Cowgill <jcowgill@debian.org>2019-07-15 23:19:42 +0100
commit9451d371d1c1fba19dd0cf8c40aeba4f86bf4aa3 (patch)
tree24d5905a611dab3b21057aab36d951f1393cb23d
parent5b3eb28d4fac54997696859f575a0aff7b2bf624 (diff)
bn_mul.h: require at least ARMv6 to enable the ARM DSP code
Commit 16b1bd89326e "bn_mul.h: add ARM DSP optimized MULADDC code" added some ARM DSP instructions that was assumed to always be available when __ARM_FEATURE_DSP is defined to 1. Unfortunately it appears that the ARMv5TE architecture (GCC flag -march=armv5te) supports the DSP instructions, but only in Thumb mode and not in ARM mode, despite defining __ARM_FEATURE_DSP in both cases. This patch fixes the build issue by requiring at least ARMv6 in addition to the DSP feature. [jcowgill: Cherry-picked from upstream PR #2169]
-rw-r--r--include/mbedtls/bn_mul.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h
index c33bd8d4..748975ea 100644
--- a/include/mbedtls/bn_mul.h
+++ b/include/mbedtls/bn_mul.h
@@ -642,7 +642,8 @@
"r6", "r7", "r8", "r9", "cc" \
);
-#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)
+#elif (__ARM_ARCH >= 6) && \
+ defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)
#define MULADDC_INIT \
asm(