* [PATCH] sbc: better compatibility with ARM thumb/thumb2
@ 2011-03-28 22:57 Siarhei Siamashka
2011-03-29 7:17 ` Johan Hedberg
0 siblings, 1 reply; 3+ messages in thread
From: Siarhei Siamashka @ 2011-03-28 22:57 UTC (permalink / raw)
To: linux-bluetooth; +Cc: paulepanter, Siarhei Siamashka
From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
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
---
sbc/sbc_math.h | 2 +-
sbc/sbc_primitives_armv6.h | 4 ++--
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
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] sbc: better compatibility with ARM thumb/thumb2
2011-03-28 22:57 [PATCH] sbc: better compatibility with ARM thumb/thumb2 Siarhei Siamashka
@ 2011-03-29 7:17 ` Johan Hedberg
2011-03-29 13:51 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2011-03-29 7:17 UTC (permalink / raw)
To: Siarhei Siamashka; +Cc: linux-bluetooth, paulepanter, Siarhei Siamashka
Hi Siarhei,
On Tue, Mar 29, 2011, Siarhei Siamashka wrote:
> 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
> ---
> sbc/sbc_math.h | 2 +-
> sbc/sbc_primitives_armv6.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sbc: better compatibility with ARM thumb/thumb2
2011-03-29 7:17 ` Johan Hedberg
@ 2011-03-29 13:51 ` Paul Menzel
0 siblings, 0 replies; 3+ messages in thread
From: Paul Menzel @ 2011-03-29 13:51 UTC (permalink / raw)
To: Johan Hedberg; +Cc: Siarhei Siamashka, linux-bluetooth, Siarhei Siamashka
[-- Attachment #1: Type: text/plain, Size: 805 bytes --]
Dear Johan, Siarhei,
Am Dienstag, den 29.03.2011, 10:17 +0300 schrieb Johan Hedberg:
> On Tue, Mar 29, 2011, Siarhei Siamashka wrote:
> > 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
> > ---
> > sbc/sbc_math.h | 2 +-
> > sbc/sbc_primitives_armv6.h | 4 ++--
> > 2 files changed, 3 insertions(+), 3 deletions(-)
>
> Pushed upstream. Thanks.
Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
Thanks,
Paul
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-29 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 22:57 [PATCH] sbc: better compatibility with ARM thumb/thumb2 Siarhei Siamashka
2011-03-29 7:17 ` Johan Hedberg
2011-03-29 13:51 ` Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox