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) {
+.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
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