diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-08-16 21:23:53 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-08-17 20:56:06 -0700 |
commit | 38e06c2969184b5b55ec41d0c053b2480ab52846 (patch) | |
tree | 07a9265ab9ef6a92292c016238009dbb8bfdbecd | |
parent | 45f861283e307c17df303d37c41bc3b2026d5ad0 (diff) | |
download | ffmpeg-38e06c2969184b5b55ec41d0c053b2480ab52846.tar.gz |
Move clipd macros to x86util.asm.
This allows sharing them between multiple .asm files.
-rw-r--r-- | libavcodec/x86/dsputil_yasm.asm | 34 | ||||
-rw-r--r-- | libavutil/x86/x86util.asm | 33 |
2 files changed, 34 insertions, 33 deletions
diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index 4e1ec24a7a..2a2108404a 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -20,6 +20,7 @@ ;****************************************************************************** %include "x86inc.asm" +%include "x86util.asm" SECTION_RODATA pb_f: times 16 db 15 @@ -1054,39 +1055,6 @@ emu_edge mmx ; int32_t max, unsigned int len) ;----------------------------------------------------------------------------- -%macro PMINSD_MMX 3 ; dst, src, tmp - mova %3, %2 - pcmpgtd %3, %1 - pxor %1, %2 - pand %1, %3 - pxor %1, %2 -%endmacro - -%macro PMAXSD_MMX 3 ; dst, src, tmp - mova %3, %1 - pcmpgtd %3, %2 - pand %1, %3 - pandn %3, %2 - por %1, %3 -%endmacro - -%macro CLIPD_MMX 3-4 ; src/dst, min, max, tmp - PMINSD_MMX %1, %3, %4 - PMAXSD_MMX %1, %2, %4 -%endmacro - -%macro CLIPD_SSE2 3-4 ; src/dst, min (float), max (float), unused - cvtdq2ps %1, %1 - minps %1, %3 - maxps %1, %2 - cvtps2dq %1, %1 -%endmacro - -%macro CLIPD_SSE41 3-4 ; src/dst, min, max, unused - pminsd %1, %3 - pmaxsd %1, %2 -%endmacro - %macro SPLATD_MMX 1 punpckldq %1, %1 %endmacro diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index 5f39107379..7e16c15db2 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -540,3 +540,36 @@ pmaxsw %1, %2 pminsw %1, %3 %endmacro + +%macro PMINSD_MMX 3 ; dst, src, tmp + mova %3, %2 + pcmpgtd %3, %1 + pxor %1, %2 + pand %1, %3 + pxor %1, %2 +%endmacro + +%macro PMAXSD_MMX 3 ; dst, src, tmp + mova %3, %1 + pcmpgtd %3, %2 + pand %1, %3 + pandn %3, %2 + por %1, %3 +%endmacro + +%macro CLIPD_MMX 3-4 ; src/dst, min, max, tmp + PMINSD_MMX %1, %3, %4 + PMAXSD_MMX %1, %2, %4 +%endmacro + +%macro CLIPD_SSE2 3-4 ; src/dst, min (float), max (float), unused + cvtdq2ps %1, %1 + minps %1, %3 + maxps %1, %2 + cvtps2dq %1, %1 +%endmacro + +%macro CLIPD_SSE41 3-4 ; src/dst, min, max, unused + pminsd %1, %3 + pmaxsd %1, %2 +%endmacro |