aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>2011-03-29 01:57:39 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-07-29 19:48:29 -0700
commit4fdd88ddf5a6b9d5d3b3b2626f0328b2ba97fa44 (patch)
tree2755ee16290c6627bdd1738be42738210abd7a26
parentfe23ba01ad6904d768e8182f6d40c432d2e070bf (diff)
sbc: better compatibility with ARM thumb/thumb2
ARM assembly optimizations fail to compile in thumb mode, but are fine for thumb2. Update ifdefs in the code to make use of ARM assembly only when it is safe and also make sure that no optimizations are missed when compiling for thumb2. The problem was reported by Paul Menzel: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-February/009022.html
-rw-r--r--sbc/sbc_math.h2
-rw-r--r--sbc/sbc_primitives_armv6.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/sbc/sbc_math.h b/sbc/sbc_math.h
index 9f126c6..5476860 100644
--- a/sbc/sbc_math.h
+++ b/sbc/sbc_math.h
@@ -48,7 +48,7 @@ typedef int32_t sbc_fixed_t;
#define SBC_FIXED_0(val) { val = 0; }
#define MUL(a, b) ((a) * (b))
-#ifdef __arm__
+#if defined(__arm__) && (!defined(__thumb__) || defined(__thumb2__))
#define MULA(a, b, res) ({ \
int tmp = res; \
__asm__( \
diff --git a/sbc/sbc_primitives_armv6.h b/sbc/sbc_primitives_armv6.h
index 1862aed..6a9efe5 100644
--- a/sbc/sbc_primitives_armv6.h
+++ b/sbc/sbc_primitives_armv6.h
@@ -40,8 +40,8 @@
#if !defined(SBC_HIGH_PRECISION) && (SCALE_OUT_BITS == 15) && \
defined(__GNUC__) && defined(SBC_HAVE_ARMV6) && \
- defined(__ARM_EABI__) && !defined(__thumb__) && \
- !defined(__ARM_NEON__)
+ defined(__ARM_EABI__) && !defined(__ARM_NEON__) && \
+ (!defined(__thumb__) || defined(__thumb2__))
#define SBC_BUILD_WITH_ARMV6_SUPPORT