[vlc-devel] [PATCH] handle the underscore prefix for some ARM ABI in arm_neon

Rafaël Carré funman at videolan.org
Fri Apr 20 22:15:12 CEST 2012


Hello,

Le 2012-04-20 12:16, David Geldreich a écrit :
> here is an altenative to using an assembly macros to handle the calling
> differences across ARM ABI.
> 
> use a gcc extension (also supported by clang/llvm) which symbol is
> associated with function

Can you explain what it does?

I don't have the iphone gcc yet but I see no difference with genuine gcc
or on Ubuntu:

% cat test.c
extern void f(void)
#ifdef ASM
asm("f")
#endif
;

void f(void)
{
}
% gcc -S test.c -o test1.s -UASM
% gcc -S test.c -o test1.s -UASM
% gcc -S test.c -o test2.s -DASM
% diff -u test1.s test2.s
% arm-elf-eabi-gcc -S test.c -o test1.s -UASM
% arm-elf-eabi-gcc -S test.c -o test2.s -DASM
% diff -u test1.s test2.s
% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
% arm-elf-eabi-gcc -v
Using built-in specs.
Target: arm-elf-eabi
Configured with: ../gcc-4.4.4/configure --target=arm-elf-eabi
--prefix=/usr/local --enable-languages=c --disable-libssp --disable-docs
Thread model: single
gcc version 4.4.4 (GCC)

> ---
>  modules/arm_neon/audio_format.c |    6 ++++--
>  modules/arm_neon/chroma_neon.h  |   23 ++++++++++++++---------
>  2 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/modules/arm_neon/audio_format.c b/modules/arm_neon/audio_format.c
> index 8db209f..3a76f18 100644
> --- a/modules/arm_neon/audio_format.c
> +++ b/modules/arm_neon/audio_format.c
> @@ -135,8 +135,10 @@ static block_t *Do_F32_S32 (filter_t *filter, block_t *inbuf)
>  }
>  #endif
>  
> -void s32_s16_neon_unaligned (int16_t *out, const int32_t *in, unsigned nb);
> -void s32_s16_neon (int16_t *out, const int32_t *in, unsigned nb);
> +extern void s32_s16_neon_unaligned (int16_t *out, const int32_t *in,
> +                                    unsigned nb) asm("s32_s16_neon_unaligned");
> +extern void s32_s16_neon (int16_t *out, const int32_t *in,
> +                          unsigned nb) asm("s32_s16_neon");
>  
>  /**
>   * Signed 32-bits fixed point to signed 16-bits integer




More information about the vlc-devel mailing list