[FFmpeg-cvslog] x86: PALIGNR: port to cpuflags
Diego Biurrun
git at videolan.org
Sat Nov 10 12:55:57 CET 2012
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sun Jul 8 01:30:30 2012 +0200| [4b60fac4199680957b15b7a08c5df47e47c6e25e] | committer: Diego Biurrun
x86: PALIGNR: port to cpuflags
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b60fac4199680957b15b7a08c5df47e47c6e25e
---
libavcodec/x86/h264_intrapred.asm | 27 ---------------------------
libavcodec/x86/h264_intrapred_10bit.asm | 16 ----------------
libavcodec/x86/h264_qpel_10bit.asm | 4 ----
libavresample/x86/audio_convert.asm | 6 ------
libavutil/x86/x86util.asm | 16 ++++++++--------
libswscale/x86/output.asm | 4 +---
6 files changed, 9 insertions(+), 64 deletions(-)
diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
index dc3d475..8faaaf4 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -1063,10 +1063,8 @@ cglobal pred8x8l_top_dc_8, 4,4
%endmacro
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
PRED8x8L_TOP_DC
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_TOP_DC
;-----------------------------------------------------------------------------
@@ -1168,10 +1166,8 @@ cglobal pred8x8l_dc_8, 4,5
%endmacro
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
PRED8x8L_DC
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_DC
;-----------------------------------------------------------------------------
@@ -1241,10 +1237,8 @@ cglobal pred8x8l_horizontal_8, 4,4
%endmacro
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
PRED8x8L_HORIZONTAL
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL
;-----------------------------------------------------------------------------
@@ -1293,10 +1287,8 @@ cglobal pred8x8l_vertical_8, 4,4
%endmacro
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
PRED8x8L_VERTICAL
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_VERTICAL
;-----------------------------------------------------------------------------
@@ -1304,7 +1296,6 @@ PRED8x8L_VERTICAL
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred8x8l_down_left_8, 4,5
sub r0, r3
movq mm0, [r0-8]
@@ -1496,10 +1487,8 @@ INIT_XMM cpuname
%endmacro
INIT_MMX sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_DOWN_LEFT
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_LEFT
;-----------------------------------------------------------------------------
@@ -1507,7 +1496,6 @@ PRED8x8L_DOWN_LEFT
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred8x8l_down_right_8, 4,5
sub r0, r3
lea r4, [r0+r3*2]
@@ -1750,10 +1738,8 @@ INIT_XMM cpuname
%endmacro
INIT_MMX sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_DOWN_RIGHT
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_RIGHT
;-----------------------------------------------------------------------------
@@ -1761,7 +1747,6 @@ PRED8x8L_DOWN_RIGHT
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred8x8l_vertical_right_8, 4,5
sub r0, r3
lea r4, [r0+r3*2]
@@ -1980,10 +1965,8 @@ INIT_XMM cpuname
%endmacro
INIT_MMX sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_VERTICAL_RIGHT
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_VERTICAL_RIGHT
;-----------------------------------------------------------------------------
@@ -2071,10 +2054,8 @@ INIT_XMM cpuname
%endmacro
INIT_MMX sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_VERTICAL_LEFT
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_VERTICAL_LEFT
;-----------------------------------------------------------------------------
@@ -2160,10 +2141,8 @@ cglobal pred8x8l_horizontal_up_8, 4,4
%endmacro
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
PRED8x8L_HORIZONTAL_UP
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL_UP
;-----------------------------------------------------------------------------
@@ -2171,7 +2150,6 @@ PRED8x8L_HORIZONTAL_UP
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred8x8l_horizontal_down_8, 4,5
sub r0, r3
lea r4, [r0+r3*2]
@@ -2411,10 +2389,8 @@ INIT_XMM cpuname
%endmacro
INIT_MMX sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_HORIZONTAL_DOWN
INIT_MMX ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL_DOWN
;-----------------------------------------------------------------------------
@@ -2637,7 +2613,6 @@ cglobal pred4x4_horizontal_up_8, 3,3
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred4x4_horizontal_down_8, 3,3
sub r0, r2
lea r1, [r0+r2*2]
@@ -2673,7 +2648,6 @@ cglobal pred4x4_horizontal_down_8, 3,3
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred4x4_vertical_right_8, 3,3
sub r0, r2
lea r1, [r0+r2*2]
@@ -2704,7 +2678,6 @@ cglobal pred4x4_vertical_right_8, 3,3
;-----------------------------------------------------------------------------
INIT_MMX mmxext
-%define PALIGNR PALIGNR_MMX
cglobal pred4x4_down_right_8, 3,3
sub r0, r2
lea r1, [r0+r2*2]
diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
index 50ebaa7..039af6d 100644
--- a/libavcodec/x86/h264_intrapred_10bit.asm
+++ b/libavcodec/x86/h264_intrapred_10bit.asm
@@ -79,10 +79,8 @@ cglobal pred4x4_down_right_10, 3, 3
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED4x4_DR
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED4x4_DR
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -120,10 +118,8 @@ cglobal pred4x4_vertical_right_10, 3, 3, 6
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED4x4_VR
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED4x4_VR
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -164,10 +160,8 @@ cglobal pred4x4_horizontal_down_10, 3, 3
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED4x4_HD
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED4x4_HD
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -726,10 +720,8 @@ cglobal pred8x8l_horizontal_10, 4, 4, 5
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_HORIZONTAL
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -796,10 +788,8 @@ cglobal pred8x8l_down_left_10, 4, 4, 7
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_DOWN_LEFT
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_LEFT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -872,10 +862,8 @@ cglobal pred8x8l_down_right_10, 4, 5, 8
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_DOWN_RIGHT
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_RIGHT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -944,10 +932,8 @@ cglobal pred8x8l_vertical_right_10, 4, 5, 7
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_VERTICAL_RIGHT
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_VERTICAL_RIGHT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
@@ -1007,10 +993,8 @@ cglobal pred8x8l_horizontal_up_10, 4, 4, 6
%endmacro
INIT_XMM sse2
-%define PALIGNR PALIGNR_MMX
PRED8x8L_HORIZONTAL_UP
INIT_XMM ssse3
-%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL_UP
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
index 4aea032..c05c7a6 100644
--- a/libavcodec/x86/h264_qpel_10bit.asm
+++ b/libavcodec/x86/h264_qpel_10bit.asm
@@ -225,25 +225,21 @@ MC00 avg
;-----------------------------------------------------------------------------
%macro MC_CACHE 1
%define OP_MOV mova
-%define PALIGNR PALIGNR_MMX
INIT_MMX mmxext
%1 put, 4
INIT_XMM sse2, cache64
%1 put, 8
INIT_XMM ssse3, cache64
-%define PALIGNR PALIGNR_SSSE3
%1 put, 8
INIT_XMM sse2
%1 put, 8, 0
%define OP_MOV AVG_MOV
-%define PALIGNR PALIGNR_MMX
INIT_MMX mmxext
%1 avg, 4
INIT_XMM sse2, cache64
%1 avg, 8
INIT_XMM ssse3, cache64
-%define PALIGNR PALIGNR_SSSE3
%1 avg, 8
INIT_XMM sse2
%1 avg, 8, 0
diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm
index 567a916..1d125c2 100644
--- a/libavresample/x86/audio_convert.asm
+++ b/libavresample/x86/audio_convert.asm
@@ -919,10 +919,8 @@ cglobal conv_s16_to_s16p_6ch, 2,7,5, dst, src, dst1, dst2, dst3, dst4, dst5
REP_RET
%endmacro
-%define PALIGNR PALIGNR_MMX
INIT_XMM sse2
CONV_S16_TO_S16P_6CH
-%define PALIGNR PALIGNR_SSSE3
INIT_XMM ssse3
CONV_S16_TO_S16P_6CH
%if HAVE_AVX_EXTERNAL
@@ -1038,10 +1036,8 @@ cglobal conv_s16_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
REP_RET
%endmacro
-%define PALIGNR PALIGNR_MMX
INIT_XMM sse2
CONV_S16_TO_FLTP_6CH
-%define PALIGNR PALIGNR_SSSE3
INIT_XMM ssse3
CONV_S16_TO_FLTP_6CH
INIT_XMM sse4
@@ -1160,10 +1156,8 @@ cglobal conv_flt_to_s16p_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
REP_RET
%endmacro
-%define PALIGNR PALIGNR_MMX
INIT_XMM sse2
CONV_FLT_TO_S16P_6CH
-%define PALIGNR PALIGNR_SSSE3
INIT_XMM ssse3
CONV_FLT_TO_S16P_6CH
%if HAVE_AVX_EXTERNAL
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index b35d594..31163ee 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -280,7 +280,14 @@
%endif
%endmacro
-%macro PALIGNR_MMX 4-5 ; [dst,] src1, src2, imm, tmp
+%macro PALIGNR 4-5
+%if cpuflag(ssse3)
+%if %0==5
+ palignr %1, %2, %3, %4
+%else
+ palignr %1, %2, %3
+%endif
+%elif cpuflag(mmx) ; [dst,] src1, src2, imm, tmp
%define %%dst %1
%if %0==5
%ifnidn %1, %2
@@ -299,13 +306,6 @@
psrldq %4, %3
%endif
por %%dst, %4
-%endmacro
-
-%macro PALIGNR_SSSE3 4-5
-%if %0==5
- palignr %1, %2, %3, %4
-%else
- palignr %1, %2, %3
%endif
%endmacro
diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
index cf0dec3..23508b8 100644
--- a/libswscale/x86/output.asm
+++ b/libswscale/x86/output.asm
@@ -246,7 +246,6 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset
%endif ; %1 == 8/9/10/16
%endmacro
-%define PALIGNR PALIGNR_MMX
%if ARCH_X86_32
INIT_MMX mmx2
yuv2planeX_fn 8, 0, 7
@@ -259,7 +258,6 @@ yuv2planeX_fn 8, 10, 7
yuv2planeX_fn 9, 7, 5
yuv2planeX_fn 10, 7, 5
-%define PALIGNR PALIGNR_SSSE3
INIT_XMM sse4
yuv2planeX_fn 8, 10, 7
yuv2planeX_fn 9, 7, 5
@@ -344,7 +342,7 @@ cglobal yuv2plane1_%1, %3, %3, %2, src, dst, w, dither, offset
%if mmsize == 16
punpcklqdq m3, m3
%endif ; mmsize == 16
- PALIGNR_MMX m3, m3, 3, m2
+ PALIGNR m3, m3, 3, m2
.no_rot:
%if mmsize == 8
mova m2, m3
More information about the ffmpeg-cvslog
mailing list