[x265] [PATCH 3 of 6] avx2: 'integral16v' asm code -> 7.25x faster than 'C' version

vignesh at multicorewareinc.com vignesh at multicorewareinc.com
Tue May 9 06:46:20 CEST 2017


# HG changeset patch
# User Jayashri Murugan <jayashri at multicorewareinc.com>
# Date 1494221566 -19800
#      Mon May 08 11:02:46 2017 +0530
# Node ID ecea0022176fa6c7e8fb8dc7be7b182bc19bab68
# Parent  128fdef63629b3fd60babcdc20536e278ec2324a
avx2: 'integral16v' asm code -> 7.25x faster than 'C' version

    integral_init16v  7.25x    203.12          1472.09

diff -r 128fdef63629 -r ecea0022176f source/common/x86/seaintegral.asm
--- a/source/common/x86/seaintegral.asm	Mon May 08 12:02:32 2017 +0530
+++ b/source/common/x86/seaintegral.asm	Mon May 08 11:02:46 2017 +0530
@@ -92,8 +92,19 @@
 ;void integral_init16v_c(uint32_t *sum16, intptr_t stride)
 ;-----------------------------------------------------------------------------
 INIT_YMM avx2
-cglobal integral16v, 2, 2, 0
- 
+cglobal integral16v, 2, 3, 2
+    mov r2, r1
+    shl r2, 6
+
+.loop
+    movu    m0, [r0]
+    movu    m1, [r0 + r2]
+    psubd   m1, m0
+    movu    [r0], m1
+    add     r0, 32
+    sub     r1, 8
+    cmp     r1, 0
+    jnz     .loop
     RET
 
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list