From: Konstantinos Margaritis Date: Wed, 21 Sep 2022 08:49:11 +0000 (+0000) Subject: Initial attempt for SVP64 asm version of vpx_get_mb_ss_svp64_real() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d428588fe3e1c31b968356993570f832253935ce;p=openpower-isa.git Initial attempt for SVP64 asm version of vpx_get_mb_ss_svp64_real() --- diff --git a/media/video/libvpx/variance_svp64.c b/media/video/libvpx/variance_svp64.c index 55e3f199..f0fc3f55 100644 --- a/media/video/libvpx/variance_svp64.c +++ b/media/video/libvpx/variance_svp64.c @@ -39,17 +39,6 @@ uint32_t vpx_get4x4sse_cs_svp64(const uint8_t *src_ptr, int src_stride, return distortion; } -/* -uint32_t vpx_get_mb_ss_svp64(const int16_t *src_ptr) { - unsigned int i, sum = 0; - - for (i = 0; i < 256; ++i) { - sum += src_ptr[i] * src_ptr[i]; - } - - return sum; -}*/ - static void variance_svp64(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int w, int h, uint32_t *sse, int *sum) { diff --git a/media/video/libvpx/variancefuncs_svp64.s b/media/video/libvpx/variancefuncs_svp64.s index 6d33d6b9..86541450 100644 --- a/media/video/libvpx/variancefuncs_svp64.s +++ b/media/video/libvpx/variancefuncs_svp64.s @@ -1,4 +1,12 @@ +.set in, 3 +.set vin, 20 +.set sum, 6 +.set ctr, 9 + + + .machine libresoc .file "variancefuncs_svp64.c" + .text .abiversion 2 .section ".text" .align 2 @@ -7,15 +15,19 @@ vpx_get_mb_ss_svp64_real: .LFB0: .cfi_startproc - addi 10,3,-2 - li 3,0 - li 9,256 - mtctr 9 + addi 10, in ,-2 + li in, 0 + li sum, 0 + li ctr, 4 + mtctr ctr + setvl 0,0,64,0,1,1 # Set VL to 64 elements .L2: - lhau 9,2(10) - mullw 9,9,9 - add 9,9,3 - rldicl 3,9,0,32 + # Load 64 ints from (in) + sv.lha *vin, 0(in) + # equivalent to: for (i = 0; i < 64; i++) sum += in[i] * in[i]; + sv.maddld sum, *vin, *vin, sum + addi in, in, 16 + rldicl in,ctr,0,32 bdnz .L2 blr .long 0