[FFmpeg-devel] [PATCH] x86/imdct36: don't build imdct36_float_sse on x86_64 targets

Ronald S. Bultje rsbultje at gmail.com
Thu Feb 27 16:39:24 CET 2014


Hi,

On Thu, Feb 27, 2014 at 4:42 AM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Thu, Feb 27, 2014 at 02:07:58AM -0300, James Almer wrote:
> > There's an SSE2 version as well, and x86_64 guarantees that
> > instruction set is present.
>
> is the size gain worth the extra ifdefery ?
> also iam not sure how likely it is but someone might want to test
> the SSE code and as is it could be done without recompiling while
> after this patch one would need to build for x86_32 first
>
> either way iam not against applying it if you/others think its better
> with that extra checks


I'm in favour of the general idea, I mean, in practice nobody will ever use
this function so testing it on x86-64 makes no sense.

Havign said that (i.e. I support the patch), I'd love if there was some
more generic way to actually make this happen. Right now we use manual
ifdeffery and that works - but it's all manual. It would be cool if our dsp
function assignment code somehow would know what functions are always
available on a given platform, and which other optimizations for the same
function already exist, so it can more efficiently remove unused and
unexported functions from the binary, i.e. in practice it should work out
to something like "if I have a sse2 version and I'm on x86-64, then don't
assign the sse version", thus making the sse function pointer unused and
removed from the binary, without the need for manal ifdeffery. Also imagine
how much C code would suddenly disappear from x86-64 builds.

But I know that's hard and I don't have a perfect system in my mind yet.
libvpx has some interesting ideas that but doesn't work for function
pointer arrays, which we use all over the place. So for now, patch is fine,
by lack of a better idea on my end. ;-).

Ronald


More information about the ffmpeg-devel mailing list