[x265] [PATCH] blockcopy_sp_4x4, optimized asm code according to modified C primitive

praveen at multicorewareinc.com praveen at multicorewareinc.com
Fri Nov 8 10:13:39 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1383902012 -19800
# Node ID 3e10b1d939e99e6e491513a1b84e35f990650643
# Parent  ebbb72654464dd24814e68e40d9504d4ad662892
blockcopy_sp_4x4, optimized asm code according to modified C primitive

diff -r ebbb72654464 -r 3e10b1d939e9 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Fri Nov 08 14:27:44 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Fri Nov 08 14:43:32 2013 +0530
@@ -921,28 +921,26 @@
 ; void blockcopy_sp_4x4(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)
 ;-----------------------------------------------------------------------------
 INIT_XMM sse2
-cglobal blockcopy_sp_4x4, 4, 5, 5, dest, destStride, src, srcStride
+cglobal blockcopy_sp_4x4, 4, 4, 4, dest, destStride, src, srcStride
 
 add        r3,     r3
 
-mova       m0,     [tab_Vm]
+movh       m0,     [r2]
+movh       m1,     [r2 + r3]
+movh       m2,     [r2 + 2 * r3]
+lea        r2,     [r2 + 2 * r3]
+movh       m3,     [r2 + r3]
 
-movh       m1,     [r2]
-movh       m2,     [r2 + r3]
-movh       m3,     [r2 + 2 * r3]
-lea        r4,     [r2 + 2 * r3]
-movh       m4,     [r4 + r3]
+packuswb   m0,            m1
+packuswb   m2,            m3
 
-pshufb     m1,     m0
-pshufb     m2,     m0
-pshufb     m3,     m0
-pshufb     m4,     m0
-
-movd       [r0],          m1
+movd       [r0],          m0
+pshufd     m0,            m0,         2
+movd       [r0 + r1],     m0
+movd       [r0 + 2 * r1], m2
+lea        r0,            [r0 + 2 * r1]
+pshufd     m2,            m2,         2
 movd       [r0 + r1],     m2
-movd       [r0 + 2 * r1], m3
-lea        r4,            [r0 + 2 * r1]
-movd       [r4 + r1],     m4
 
 RET
 


More information about the x265-devel mailing list