[x265] [PATCH] blockcopy_pp_32x16: avx asm code, improved 477.74 cycles -> 309.99

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Sep 24 13:36:15 CEST 2014


# HG changeset patch
# User Praveen Tiwari
# Date 1411558542 -19800
# Node ID 6567162bf00cfc2ac764e51f98d76bfcf3de5c5a
# Parent  75100f06532c99839c11a4dbae51db96f7d337b7
blockcopy_pp_32x16: avx asm code, improved 477.74 cycles -> 309.99

diff -r 75100f06532c -r 6567162bf00c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Sep 24 16:01:10 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Sep 24 17:05:42 2014 +0530
@@ -1717,6 +1717,10 @@
 
         p.chroma[X265_CSP_I420].copy_pp[CHROMA_32x8] = x265_blockcopy_pp_32x8_avx;
         p.luma_copy_pp[LUMA_32x8] = x265_blockcopy_pp_32x8_avx;
+
+        p.chroma[X265_CSP_I420].copy_pp[CHROMA_32x16] = x265_blockcopy_pp_32x16_avx;
+        p.chroma[X265_CSP_I422].copy_pp[CHROMA422_32x16] = x265_blockcopy_pp_32x16_avx;
+        p.luma_copy_pp[LUMA_32x16] = x265_blockcopy_pp_32x16_avx;
     }
     if (cpuMask & X265_CPU_XOP)
     {
diff -r 75100f06532c -r 6567162bf00c source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Wed Sep 24 16:01:10 2014 +0530
+++ b/source/common/x86/blockcopy8.asm	Wed Sep 24 17:05:42 2014 +0530
@@ -633,6 +633,57 @@
     movu    [r0 + r4], m1
     RET
 
+INIT_YMM avx
+cglobal blockcopy_pp_32x16, 4, 6, 6
+    lea    r4,  [3 * r1]
+    lea    r5,  [3 * r3]
+
+    movu    m0, [r2]
+    movu    m1, [r2 + r3]
+    movu    m2, [r2 + 2 * r3]
+    movu    m3, [r2 + r5]
+    lea     r2, [r2 + 4 * r3]
+    movu    m4, [r2]
+    movu    m5, [r2 + r3]
+
+    movu    [r0], m0
+    movu    [r0 + r1], m1
+    movu    [r0 + 2 * r1], m2
+    movu    [r0 + r4], m3
+    lea     r0, [r0 + 4 * r1]
+    movu    [r0], m4
+    movu    [r0 + r1], m5
+
+    movu    m0, [r2 + 2 * r3]
+    movu    m1, [r2 + r5]
+    lea     r2, [r2 + 4 * r3]
+    movu    m2, [r2]
+    movu    m3, [r2 + r3]
+    movu    m4, [r2 + 2 * r3]
+    movu    m5, [r2 + r5]
+
+    movu    [r0 + 2 * r1], m0
+    movu    [r0 + r4], m1
+    lea     r0, [r0 + 4 * r1]
+    movu    [r0], m2
+    movu    [r0 + r1], m3
+    movu    [r0 + 2 * r1], m4
+    movu    [r0 + r4], m5
+
+    lea     r2, [r2 + 4 * r3]
+    movu    m0, [r2]
+    movu    m1, [r2 + r3]
+    movu    m2, [r2 + 2 * r3]
+    movu    m3, [r2 + r5]
+
+    lea     r0, [r0 + 4 * r1]
+    movu    [r0], m0
+    movu    [r0 + r1], m1
+    movu    [r0 + 2 * r1], m2
+    movu    [r0 + r4], m3
+    RET
+
+
 ;-----------------------------------------------------------------------------
 ; void blockcopy_pp_%1x%2(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)
 ;-----------------------------------------------------------------------------
diff -r 75100f06532c -r 6567162bf00c source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Wed Sep 24 16:01:10 2014 +0530
+++ b/source/common/x86/blockcopy8.h	Wed Sep 24 17:05:42 2014 +0530
@@ -195,6 +195,7 @@
 void x265_blockcopy_ss_64x64_avx(int16_t *dest, intptr_t deststride, int16_t *src, intptr_t srcstride);
 
 void x265_blockcopy_pp_32x8_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
+void x265_blockcopy_pp_32x16_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
 
 #undef BLOCKCOPY_COMMON
 #undef BLOCKCOPY_SS_PP


More information about the x265-devel mailing list