[FFmpeg-devel] [PATCH] fix compiling VIS assembly on SPARC

Balatoni Denes dbalatoni
Thu Sep 13 23:13:49 CEST 2007


Thursday 13 September 2007 11:12-kor Diego Biurrun ezt ?rta:
> > > +sparc/simple_idct_vis.o: CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc
> >
> > You can merge the two rules like this:
> >
> >   sparc/dsputil_vis.o sparc/simple_idct_vis.o: CFLAGS += -mcpu=ultrasparc
> > -mtune=ultrasparc
> Applied with that modification.

Thanks. Sorry I didn't have time to fix the patch up.

> > But I wonder why this has to be set only for those two files and not for
> > everything ...
> Denes, could you tell me why this is not set by configure, possibly for
> all files?

The short answer is imho that it should be, with CPU detection in configure 
and HAVE_VIS, exactly the way it is done in mplayer.
A longer answer is, that actually the -mcpu=ultrasparc was not needed even 
there, as it was not strictly needed before (only the new idct code has 
inline VIS assembly), but it made the runtime VIS detection redundant - 
because it is signalled in the elf header somewhere that the binary uses VIS 
when compiled with mcpu=ultrasparc, so non-VIS CPUs would refuse to execute 
the program, therby making the runtime CPU detection kind of redundant. The 
older VIS code uses machine code (assembled by elaborate C macros), so the 
compiler didn't know there was VIS, it wouldn't have actually complained 
without -mcpu=ultrasparc and wouldn't have signalled VIS usage in the ELF 

I am afraid my answer was a bit too convoluted, so yes, imho ultrasparc should 
be detected by configure, and give -mcpu=ultrasparc to the compiler for all 
files - exactly like in mplayer (half of the runtime cpu detection code is 
not needed then, however the VIS_2_ detection part would still be needed, 
unless configure has a way to find out if the CPU is an ultrasparc III or T2 
or just plain old ultrasparc I or II or T1 (but I don't think that could be 
done easily in configure)).

> Diego


More information about the ffmpeg-devel mailing list