No subject


Thu Apr 11 16:32:37 PDT 2013


optimizations done for this CPU architecture. Whether it is in-line assembly
or assembly optimization of function (Eg: celt_pitch_xcorr_arm.s), or using
intrinsics, it is still some optimizations.

So, I don't understand your perspective. I really thought about this
for the most
amount of time... could you please suggest an alternative here?.. Because I'm
really out of ideas in this area and could use some advise / direction.

> For example, are these tests (especially the PRESUME_NEON stuff) going
> to do the right thing on aarch64?
As I understand, PRESUME_NEON to me means the compiler supports generating
ARM neon code and also we are ensuring at compile time that the target will
definitely have NEON. For aarch64 code, this code path will not even execute.

All above code path is only for

case $host_cpu in
      arm*)
and this should work for ARMv8 (aarch32) mode as well. (I think..
please correct if
necessary)

For aarch64,
case $host_cpu in
      aarch64*)
the configure.ac code should be much smaller as we can make valid
assumption that
NEON will be supported... so as Jonathan Lennox suggested earlier,
most of these flags
can be hardcoded..... even run time checks can be disabled as ARMv8
cpu in aarch64
mode is guaranteed to have NEON/ASIMD.

>
>>               AS_GCC_INLINE_ASSEMBLY(
>>                   [inline_optimization="ARM"],
>>                   [inline_optimization="disabled"]
>> @@ -212,6 +211,35 @@ AS_IF([test x"${enable_asm}" = x"yes"],[
>>               AS_ASM_ARM_MEDIA([OPUS_ARM_INLINE_MEDIA=1],
>>                   [OPUS_ARM_INLINE_MEDIA=0])
>>               AS_ASM_ARM_NEON([OPUS_ARM_INLINE_NEON=1],[OPUS_ARM_INLINE_NEON=0])
>> +
>> +         AC_ARG_ENABLE([arm-neon-intrinsics],
>> +             AS_HELP_STRING([--enable-arm-neon-intrinsics], [Enable NEON optimisations on ARM CPUs that support it]))
>
> This should specify a default value for enable_arm_neon_intrinsics.
> However, I really think this switch should be unified with the
> --enable-intrinsics switch currently used by x86.
OK, will do.
>
>> +
>> +         AS_IF([test x"$enable_arm_neon_intrinsics" = x"yes"],
>> +             [
>> +             AC_MSG_CHECKING(if compiler supports arm neon intrinsics)
>> +             save_CFLAGS="$CFLAGS"
>> +             save_CFLAGS="$CFLAGS"; CFLAGS="-mfpu=neon $CFLAGS"
>> +             AC_COMPILE_IFELSE(
>> +                 [AC_LANG_PROGRAM([[#include <arm_neon.h>]], [])],
>> +                 [
>> +                     OPUS_ARM_NEON_INTR=1
>> +                     OPUS_ARM_NEON_INTR_CPPFLAGS="-mfpu=neon -O3"
>> +                     AC_SUBST(OPUS_ARM_NEON_INTR_CPPFLAGS)
>> +                 ],
>> +                 [
>> +                     OPUS_ARM_NEON_INTR=0
>> +                 ])
>> +             CFLAGS="$save_CFLAGS"
>> +             AS_IF([test x"$OPUS_ARM_NEON_INTR"=x"1"],
>> +                 [AC_MSG_RESULT([yes])],
>> +                 [AC_MSG_RESULT([no])])
>> +             ],
>> +             [
>> +                 OPUS_ARM_NEON_INTR=0
>> +                 AC_MSG_WARN([ARMv7 neon intrinsics not enabled])
>> +             ])
>> +
>>               AS_IF([test x"$inline_optimization" = x"ARM"],[
>>                   AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],[true])
>>                   AC_DEFINE([OPUS_ARM_INLINE_ASM], 1,
>> @@ -220,7 +248,7 @@ AS_IF([test x"${enable_asm}" = x"yes"],[
>>                       AC_DEFINE([OPUS_ARM_INLINE_EDSP], [1],
>>                           [Use ARMv5E inline asm optimizations])
>>                       inline_optimization="$inline_optimization (EDSP)"
>> -                ])
>> +                ]n)
>
> Buh?
Sorry.. no idea how this "n" snuck in.. will take it out. Good catch!
>
>>                   AS_IF([test x"$OPUS_ARM_INLINE_MEDIA" = x"1"],[
>>                       AC_DEFINE([OPUS_ARM_INLINE_MEDIA], [1],
>>                           [Use ARMv6 inline asm optimizations])
>> @@ -335,13 +363,20 @@ AS_IF([test x"${enable_asm}" = x"yes"],[
>>                     [*** ARM assembly requires perl -- disabling optimizations])
>>                   asm_optimization="(missing perl dependency for ARM)"
>>               ])
>> -        ])
>> +        AS_IF([test x"$OPUS_ARM_NEON_INTR" = x"1"], [
>> +             AC_DEFINE([OPUS_ARM_NEON_INTR], 1,
>> +                     [Compiler supports ARMv7 Neon Intrinsics]),
>> +             AS_IF([test x"$OPUS_ARM_PRESUME_NEON" = x"1"], [
>> +                     AC_DEFINE([OPUS_PRESUME_NEON_INTR], 1,
>> +                         [Compiler support arm Intrinsics and target must support neon])],
>> +                     [])
>> +             AS_IF([test x"enable_rtcd" != x""],
>> +                     [rtcd_support="$rtcd_support (NEON_INTR)"],
>> +                     [])
>> +             ],[])
>>           ;;
>>       esac
>> -],[
>> -   inline_optimization="disabled"
>> -   asm_optimization="disabled"
>> -])
>> +],[])
>>
>>   AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"])
>>   AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],
>> @@ -349,6 +384,9 @@ AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],
>>   AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM],
>>       [test x"${asm_optimization%% *}" = x"ARM"])
>>
>> +AM_CONDITIONAL([OPUS_ARM_NEON_INTR],
>> +    [test x"$OPUS_ARM_NEON_INTR" = x"1"])
>> +
>>   AM_CONDITIONAL([HAVE_SSE4_1], [false])
>>   AM_CONDITIONAL([HAVE_SSE2], [false])
>>   AS_IF([test x"$enable_intrinsics" = x"yes"],[
>
> _______________________________________________
> opus mailing list
> opus at xiph.org
> http://lists.xiph.org/mailman/listinfo/opus


More information about the opus mailing list