Janne Grunau <[email protected]> writes:

> On 2012-12-05 02:29:02 +0000, Måns Rullgård wrote:
>> This allows compiling optimised functions for features not enabled
>> in the core build and selecting these at runtime if the system has
>> the necessary support.
>> 
>> Signed-off-by: Mans Rullgard <[email protected]>
>> ---
>> This version does not rely on headers missing on Android, but rather
>> includes a copy of the (trivial) definitions.  The kernel interface is
>> stable, so this does not pose a compatibility problem.
>> 
>> Also changed is the returned flags if /proc/self/auxv could not be opened.
>> Instead of returning zero as in previous versions of the patch, the flags
>> corresponding to the base build options are used.  Features signalled in
>> auxv are merely added to this set with nothing being removed.  This way
>> the base feature set is always fully utilised, even if runtime detection
>> somehow fails.
>> ---
>>  configure           |  4 ++-
>>  libavutil/arm/cpu.c | 83 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 86 insertions(+), 1 deletion(-)
>> 
>> diff --git a/configure b/configure
>> index bf6aceb..63a5d6f 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3175,7 +3175,9 @@ EOF
>>      enabled vfp     && check_insn vfp     'fadds s0, s0, s0'
>>      enabled vfpv3   && check_insn vfpv3   'vmov.f32 s0, #1.0'
>>  
>> -    map 'enabled_any ${v}_external ${v}_inline || disable $v' 
>> $ARCH_EXT_LIST_ARM
>> +    [ $target_os = linux ] ||
>> +        map 'enabled_any ${v}_external ${v}_inline || disable $v' \
>> +            $ARCH_EXT_LIST_ARM
>
> What is the intentention for the plain HAVE_CPU_EXT? Trying not to use
> it to the point of removing it?

HAVE_FOO:          will build runtime-selectable asm using FOO
HAVE_FOO_INLINE:   FOO allowed in inline asm
HAVE_FOO_EXTERNAL: FOO allowed anywhere in asm, mostly used to enable
                   armv6t2 movw/movt in functions marked armv6

>>      check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
>>      check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
>> diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
>> index 7058aeb..041afc9 100644
>> --- a/libavutil/arm/cpu.c
>> +++ b/libavutil/arm/cpu.c
>> @@ -19,6 +19,87 @@
>>  #include "libavutil/cpu.h"
>>  #include "config.h"
>>  
>> +#define CORE_FLAG(f) \
>> +    (AV_CPU_FLAG_ ## f * (HAVE_ ## f ## _EXTERNAL || HAVE_ ## f ## _INLINE))
>
> This is a duplication of the configure code,

No, it's not.

> ok if we want to stop using the plain HAVE_CPU_EXT. Although I'm not
> sure how that matches the base build description from above. did you
> mean
>
>     (AV_CPU_FLAG_ ## f * (HAVE_ ## f || HAVE_ ## f ## _INLINE)) ?

That would always enable everything, contrary to the purpose of this patch.

>> +int ff_get_cpu_flags_arm(void)
>> +{
>> +    int flags = CORE_CPU_FLAGS;
>
> this is not going to work with only bitwise or and as noted above

Yes, it is and it does.  CORE_CPU_FLAGS represents features the compiler
is allowed to use everywhere so there is no point in disabling them.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to