[FFmpeg-devel] [RFC] insufficient VFP check?

Reimar Döffinger Reimar.Doeffinger
Sun Jan 17 00:59:40 CET 2010


On Sat, Jan 16, 2010 at 11:44:25PM +0000, M?ns Rullg?rd wrote:
> M?ns Rullg?rd <mans at mansr.com> writes:
> 
> > Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> >
> >> Hello,
> >> the configure vfp check looks for
> >> fadds s0, s0, s0
> >> However, this detects VFP e.g. for
> >> -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp
> >> while actual compilation fails with e.g.
> >> libavcodec/arm/dsputil_vfp.S:160: Error: selected processor does not support `vmov r7,r8,s4,s5'
> >> So what is the right solution, replace the check with something
> >> like the failing instruction?
> >
> > What configure line did you use?  It always works for me...
> 
> And what was the exact command that failed?

Really funny, with the exact same compiler command-line this works:
vfp.c
int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }

whereas this:
vfp.S
fadds s0, s0, s0

gives
vfp.S: Assembler messages:
vfp.S:1: Error: selected processor does not support `fadds s0,s0,s0'


The source file generated from the .c code gives this, which compiles fine,
the critical part ebing either .fpu neon or .fpu vfp:
(using armv7a-softfloat-linux-gnueabi-gcc (Gentoo 4.4.2 p1.0) 4.4.2, GNU assembler (GNU Binutils) 2.20):
        .cpu cortex-a8
        .eabi_attribute 27, 3
        .fpu neon
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 6
        .eabi_attribute 18, 4
        .file   "vfp.c"
        .text
        .align  2
        .global main
        .type   main, %function
main:  
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 1, uses_anonymous_args = 0
        @ link register save eliminated.
        str     fp, [sp, #-4]!
        add     fp, sp, #0
#APP
@ 1 "vfp.c" 1
        fadds s0, s0, s0
@ 0 "" 2
        mov     r3, #0
        mov     r0, r3
        add     sp, fp, #0
        ldmfd   sp!, {fp}
        bx      lr
        .size   main, .-main
        .ident  "GCC: (Gentoo 4.4.2 p1.0) 4.4.2"
        .section        .note.GNU-stack,"",%progbits



More information about the ffmpeg-devel mailing list