[FFmpeg-devel] [PATCH] Add x86-optimized versions of exponent_min().
Ronald S. Bultje
rsbultje
Fri Jan 28 22:09:09 CET 2011
Hi,
On Fri, Jan 28, 2011 at 2:39 PM, Justin Ruggles
<justin.ruggles at gmail.com> wrote:
> ---
> ?libavcodec/Makefile ? ? ? ? | ? ?6 +++-
> ?libavcodec/ac3dsp.c ? ? ? ? | ? 51 ++++++++++++++++++++++++++++++++++++
> ?libavcodec/ac3dsp.h ? ? ? ? | ? 44 +++++++++++++++++++++++++++++++
> ?libavcodec/ac3enc.c ? ? ? ? | ? 35 +++++-------------------
> ?libavcodec/x86/Makefile ? ? | ? ?4 +++
> ?libavcodec/x86/ac3dsp.asm ? | ? 61 +++++++++++++++++++++++++++++++++++++++++++
> ?libavcodec/x86/ac3dsp_mmx.c | ? 47 +++++++++++++++++++++++++++++++++
> ?libavcodec/x86/x86util.asm ?| ? ?6 ++++
> ?8 files changed, 224 insertions(+), 30 deletions(-)
> ?create mode 100644 libavcodec/ac3dsp.c
> ?create mode 100644 libavcodec/ac3dsp.h
> ?create mode 100644 libavcodec/x86/ac3dsp.asm
> ?create mode 100644 libavcodec/x86/ac3dsp_mmx.c
>
> New patch. Added HAVE_YASM around yasm function prototypes and assignments.
[..]
> + if (mm_flags & AV_CPU_FLAG_SSE2) {
HAVE_SSE2 also
> +%macro PMINUB_MMX 3 ; dst, src, tmp
> + mova %3, %1
> + psubusb %3, %2
> + psubb %1, %3
> +%endmacro
[..]
> +%ifidn %1, mmx
> + PMINUB_MMX m0, [expq+offsetq], m1
> +%else ; mmxext/sse2
> + pminub m0, [expq+offsetq]
> +%endif
Since you're using it under %if .. anyway, the point of having this
macro is sort of lost. Maybe I'd integrate this in the source, or
otherwise also template pminub on >= mmx2 so that the %if is no longer
necessary.
The asm itself looks sane to me.
Ronald
More information about the ffmpeg-devel
mailing list