diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2012-07-04 11:07:49 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-07-05 17:37:11 +0200 |
commit | 4d4752366f873fde444815b9a0a8f1077073d266 (patch) | |
tree | 1b20b284f807fb1fafabfba826a1451b97a4fd93 /libavutil | |
parent | 2cd1f5cadcab6c6c992c3d07575f76e3e6e59c0e (diff) | |
download | ffmpeg-4d4752366f873fde444815b9a0a8f1077073d266.tar.gz |
x86inc: add SPLATB_LOAD, SPLATB_REG, PSHUFLW macros
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/x86/x86util.asm | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index 066384b4c7..941ec76084 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -256,15 +256,26 @@ %define ABSB ABSB_MMX %define ABSB2 ABSB2_MMX -%macro SPLATB_MMX 3 +%macro SPLATB_LOAD 3 +%if cpuflag(ssse3) + movd %1, [%2-3] + pshufb %1, %3 +%else movd %1, [%2-3] ;to avoid crossing a cacheline punpcklbw %1, %1 SPLATW %1, %1, 3 +%endif %endmacro -%macro SPLATB_SSSE3 3 - movd %1, [%2-3] +%macro SPLATB_REG 3 +%if cpuflag(ssse3) + movd %1, %2d pshufb %1, %3 +%else + movd %1, %2d + punpcklbw %1, %1 + SPLATW %1, %1, 0 +%endif %endmacro %macro PALIGNR_MMX 4-5 ; [dst,] src1, src2, imm, tmp @@ -296,6 +307,14 @@ %endif %endmacro +%macro PSHUFLW 1+ + %if mmsize == 8 + pshufw %1 + %else + pshuflw %1 + %endif +%endmacro + %macro DEINTB 5 ; mask, reg1, mask, reg2, optional src to fill masks from %ifnum %5 pand m%3, m%5, m%4 ; src .. y6 .. y4 @@ -521,8 +540,22 @@ %if mmsize == 16 pshuflw %1, %2, (%3)*0x55 punpcklqdq %1, %1 -%else +%elif cpuflag(mmx2) pshufw %1, %2, (%3)*0x55 +%else + %ifnidn %1, %2 + mova %1, %2 + %endif + %if %3 & 2 + punpckhwd %1, %1 + %else + punpcklwd %1, %1 + %endif + %if %3 & 1 + punpckhwd %1, %1 + %else + punpcklwd %1, %1 + %endif %endif %endmacro |