[x265] [PATCH] blockcopy_pp_8x32: sse2 asm code optimization

praveen at multicorewareinc.com praveen at multicorewareinc.com
Tue Feb 3 13:56:31 CET 2015


# HG changeset patch
# User Praveen Tiwari
# Date 1422968182 -19800
# Node ID a7dff1040961c2c17254c2e2bb0bf5b7857c8187
# Parent  fc36f92d7075e8291554e687534e2060e9e66df0
blockcopy_pp_8x32: sse2 asm code optimization

improved, 394.92c -> 368.48c

diff -r fc36f92d7075 -r a7dff1040961 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Tue Feb 03 18:16:26 2015 +0530
+++ b/source/common/x86/blockcopy8.asm	Tue Feb 03 18:26:22 2015 +0530
@@ -448,6 +448,40 @@
     RET
 
 ;-----------------------------------------------------------------------------
+; void blockcopy_pp_8x32(pixel* dst, intptr_t dstStride, const pixel* src, intptr_t srcStride)
+;-----------------------------------------------------------------------------
+INIT_XMM sse2
+cglobal blockcopy_pp_8x32, 4, 6, 4
+
+    lea      r4, [3 * r3]
+    lea      r5, [3 * r1]
+
+    movh     m0, [r2]
+    movh     m1, [r2 + r3]
+    movh     m2, [r2 + 2 * r3]
+    movh     m3, [r2 + r4]
+
+    movh     [r0],          m0
+    movh     [r0 + r1],     m1
+    movh     [r0 + 2 * r1], m2
+    movh     [r0 + r5],     m3
+
+    %rep 7
+    lea      r2, [r2 + 4 * r3]
+    movh     m0, [r2]
+    movh     m1, [r2 + r3]
+    movh     m2, [r2 + 2 * r3]
+    movh     m3, [r2 + r4]
+
+    lea      r0,            [r0 + 4 * r1]
+    movh     [r0],          m0
+    movh     [r0 + r1],     m1
+    movh     [r0 + 2 * r1], m2
+    movh     [r0 + r5],     m3
+    %endrep
+    RET
+
+;-----------------------------------------------------------------------------
 ; void blockcopy_pp_%1x%2(pixel* dst, intptr_t dstStride, const pixel* src, intptr_t srcStride)
 ;-----------------------------------------------------------------------------
 %macro BLOCKCOPY_PP_W8_H8 2
@@ -488,7 +522,6 @@
 RET
 %endmacro
 
-BLOCKCOPY_PP_W8_H8 8, 32
 
 BLOCKCOPY_PP_W8_H8 8, 64
 


More information about the x265-devel mailing list