2010-05-18 17:58:33 +02:00
|
|
|
;
|
2010-09-09 14:16:39 +02:00
|
|
|
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
;
|
2010-06-18 18:39:21 +02:00
|
|
|
; Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
; that can be found in the LICENSE file in the root of the source
|
|
|
|
; tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
; in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
; be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
%include "vpx_ports/x86_abi_support.asm"
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
;int vp9_block_error_xmm(short *coeff_ptr, short *dcoef_ptr)
|
2012-12-20 18:40:18 +01:00
|
|
|
global sym(vp9_block_error_xmm) PRIVATE
|
2012-10-30 20:58:42 +01:00
|
|
|
sym(vp9_block_error_xmm):
|
2010-05-18 17:58:33 +02:00
|
|
|
push rbp
|
|
|
|
mov rbp, rsp
|
|
|
|
SHADOW_ARGS_TO_STACK 2
|
|
|
|
push rsi
|
|
|
|
push rdi
|
2010-06-16 18:36:53 +02:00
|
|
|
; end prologue
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
mov rsi, arg(0) ;coeff_ptr
|
|
|
|
mov rdi, arg(1) ;dcoef_ptr
|
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
movdqa xmm0, [rsi]
|
|
|
|
movdqa xmm1, [rdi]
|
|
|
|
|
|
|
|
movdqa xmm2, [rsi+16]
|
|
|
|
movdqa xmm3, [rdi+16]
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
psubw xmm0, xmm1
|
|
|
|
psubw xmm2, xmm3
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
pmaddwd xmm0, xmm0
|
|
|
|
pmaddwd xmm2, xmm2
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
paddd xmm0, xmm2
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
pxor xmm5, xmm5
|
|
|
|
movdqa xmm1, xmm0
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
punpckldq xmm0, xmm5
|
|
|
|
punpckhdq xmm1, xmm5
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-04-07 19:17:22 +02:00
|
|
|
paddd xmm0, xmm1
|
|
|
|
movdqa xmm1, xmm0
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
psrldq xmm0, 8
|
2011-04-07 19:17:22 +02:00
|
|
|
paddd xmm0, xmm1
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2010-10-04 23:19:33 +02:00
|
|
|
movq rax, xmm0
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
pop rdi
|
|
|
|
pop rsi
|
|
|
|
; begin epilog
|
|
|
|
UNSHADOW_ARGS
|
|
|
|
pop rbp
|
|
|
|
ret
|
|
|
|
|
2012-10-30 20:58:42 +01:00
|
|
|
;int vp9_block_error_mmx(short *coeff_ptr, short *dcoef_ptr)
|
2012-12-20 18:40:18 +01:00
|
|
|
global sym(vp9_block_error_mmx) PRIVATE
|
2012-10-30 20:58:42 +01:00
|
|
|
sym(vp9_block_error_mmx):
|
2010-05-18 17:58:33 +02:00
|
|
|
push rbp
|
|
|
|
mov rbp, rsp
|
|
|
|
SHADOW_ARGS_TO_STACK 2
|
|
|
|
push rsi
|
|
|
|
push rdi
|
|
|
|
; end prolog
|
|
|
|
|
|
|
|
|
|
|
|
mov rsi, arg(0) ;coeff_ptr
|
|
|
|
pxor mm7, mm7
|
|
|
|
|
|
|
|
mov rdi, arg(1) ;dcoef_ptr
|
|
|
|
movq mm3, [rsi]
|
|
|
|
|
|
|
|
movq mm4, [rdi]
|
|
|
|
movq mm5, [rsi+8]
|
|
|
|
|
|
|
|
movq mm6, [rdi+8]
|
|
|
|
pxor mm1, mm1 ; from movd mm1, dc ; dc =0
|
|
|
|
|
|
|
|
movq mm2, mm7
|
|
|
|
psubw mm5, mm6
|
|
|
|
|
|
|
|
por mm1, mm2
|
|
|
|
pmaddwd mm5, mm5
|
|
|
|
|
|
|
|
pcmpeqw mm1, mm7
|
|
|
|
psubw mm3, mm4
|
|
|
|
|
|
|
|
pand mm1, mm3
|
|
|
|
pmaddwd mm1, mm1
|
|
|
|
|
|
|
|
paddd mm1, mm5
|
|
|
|
movq mm3, [rsi+16]
|
|
|
|
|
|
|
|
movq mm4, [rdi+16]
|
|
|
|
movq mm5, [rsi+24]
|
|
|
|
|
|
|
|
movq mm6, [rdi+24]
|
|
|
|
psubw mm5, mm6
|
|
|
|
|
|
|
|
pmaddwd mm5, mm5
|
|
|
|
psubw mm3, mm4
|
|
|
|
|
|
|
|
pmaddwd mm3, mm3
|
|
|
|
paddd mm3, mm5
|
|
|
|
|
|
|
|
paddd mm1, mm3
|
|
|
|
movq mm0, mm1
|
|
|
|
|
|
|
|
psrlq mm1, 32
|
|
|
|
paddd mm0, mm1
|
|
|
|
|
2010-10-04 23:19:33 +02:00
|
|
|
movq rax, mm0
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
pop rdi
|
|
|
|
pop rsi
|
|
|
|
; begin epilog
|
|
|
|
UNSHADOW_ARGS
|
|
|
|
pop rbp
|
|
|
|
ret
|