From 58b2e457824dc93916233627b98614409e5f258d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 23 Mar 2023 18:16:15 +0000 Subject: Fix unified syntax in ARM inline assembly GCC 4.9 always emits assembly with divided syntax. Setting unified syntax in inline assembly causes the assembler to complain about GCC's generated code, because the directive extends past the scope of the inline asm. Fix this by setting divided mode at the end of the inline assembly block. The assembler directives are hidden behind macros because later versions of GCC won't need this workaround: they can be told to use the unified syntax with -masm-syntax-unified. Change-Id: Ic09e729e5bbb6fd44d08dac348daf6f55c75d7d8 --- lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h') diff --git a/lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h b/lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h index 1da090efbb..ad5eed60fb 100644 --- a/lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h +++ b/lib/rbcodec/codecs/demac/libdemac/vector_math16_armv6.h @@ -45,7 +45,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) #endif asm volatile ( - ".syntax unified \n" + BEGIN_ARM_ASM_SYNTAX_UNIFIED #if ORDER > 32 "mov %[res], #0 \n" #endif @@ -186,6 +186,7 @@ static inline int32_t vector_sp_add(int16_t* v1, int16_t* f2, int16_t* s2) #endif "99: \n" + END_ARM_ASM_SYNTAX_UNIFIED : /* outputs */ #if ORDER > 32 [cnt]"+r"(cnt), @@ -215,7 +216,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) #endif asm volatile ( - ".syntax unified \n" + BEGIN_ARM_ASM_SYNTAX_UNIFIED #if ORDER > 32 "mov %[res], #0 \n" #endif @@ -356,6 +357,7 @@ static inline int32_t vector_sp_sub(int16_t* v1, int16_t* f2, int16_t* s2) #endif "99: \n" + END_ARM_ASM_SYNTAX_UNIFIED : /* outputs */ #if ORDER > 32 [cnt]"+r"(cnt), @@ -383,7 +385,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) #endif asm volatile ( - ".syntax unified \n" + BEGIN_ARM_ASM_SYNTAX_UNIFIED #if ORDER > 32 "mov %[res], #0 \n" #endif @@ -477,6 +479,7 @@ static inline int32_t scalarproduct(int16_t* v1, int16_t* v2) #endif "99: \n" + END_ARM_ASM_SYNTAX_UNIFIED : /* outputs */ #if ORDER > 32 [cnt]"+r"(cnt), -- cgit v1.2.3