[x265] [PATCH] blockcopy_sp_8x4, optimized asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Fri Nov 8 12:10:37 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1383909028 -19800
# Node ID 43e537f064b98e20b7dec87fecc831e298f5b661
# Parent  ca406614f803412b3a8bd6e2eac1774e6d9615fc
blockcopy_sp_8x4, optimized asm code

diff -r ca406614f803 -r 43e537f064b9 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Fri Nov 08 16:25:45 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Fri Nov 08 16:40:28 2013 +0530
@@ -1118,28 +1118,24 @@
 ; void blockcopy_sp_8x4(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)
 ;-----------------------------------------------------------------------------
 INIT_XMM sse2
-cglobal blockcopy_sp_8x4, 4, 5, 5, dest, destStride, src, srcStride
+cglobal blockcopy_sp_8x4, 4, 4, 4, dest, destStride, src, srcStride
 
 add        r3,     r3
 
-mova       m0,     [tab_Vm]
+movu       m0,     [r2]
+movu       m1,     [r2 + r3]
+movu       m2,     [r2 + 2 * r3]
+lea        r2,     [r2 + 2 * r3]
+movu       m3,     [r2 + r3]
 
-movu       m1,     [r2]
-movu       m2,     [r2 + r3]
-movu       m3,     [r2 + 2 * r3]
-lea        r4,     [r2 + 2 * r3]
-movu       m4,     [r4 + r3]
+packuswb   m0,            m1
+packuswb   m2,            m3
 
-pshufb     m1,     m0
-pshufb     m2,     m0
-pshufb     m3,     m0
-pshufb     m4,     m0
-
-movh       [r0],          m1
-movh       [r0 + r1],     m2
-movh       [r0 + 2 * r1], m3
-lea        r4,            [r0 + 2 * r1]
-movh       [r4 + r1],     m4
+movlps     [r0],          m0
+movhps     [r0 + r1],     m0
+movlps     [r0 + 2 * r1], m2
+lea        r0,            [r0 + 2 * r1]
+movhps     [r0 + r1],     m2
 
 RET
 


More information about the x265-devel mailing list