2 ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 ; Use of this source code is governed by a BSD-style license
5 ; that can be found in the LICENSE file in the root of the source
6 ; tree. An additional intellectual property rights grant can be found
7 ; in the file PATENTS. All contributing project authors may
8 ; be found in the AUTHORS file in the root of the source tree.
12 %include "vpx_ports/x86_abi_support.asm"
14 ;void vp8_short_walsh4x4_sse2(short *input, short *output, int pitch)
15 global sym(vp8_short_walsh4x4_sse2)
16 sym(vp8_short_walsh4x4_sse2):
19 SHADOW_ARGS_TO_STACK 3
27 movdqu xmm4, [rsi + 0] ;ip[4] ip[0]
28 movdqu xmm0, [rsi + 16] ;ip[12] ip[8]
31 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 ; 13 12 11 10 03 02 01 00
34 ; 33 32 31 30 23 22 21 20
36 movdqa xmm3, xmm4 ; 13 12 11 10 03 02 01 00
37 punpcklwd xmm4, xmm0 ; 23 03 22 02 21 01 20 00
38 punpckhwd xmm3, xmm0 ; 33 13 32 12 31 11 30 10
39 movdqa xmm1, xmm4 ; 23 03 22 02 21 01 20 00
40 punpcklwd xmm4, xmm3 ; 31 21 11 01 30 20 10 00
41 punpckhwd xmm1, xmm3 ; 33 23 13 03 32 22 12 02
42 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 pshufd xmm2, xmm1, 4eh ;ip[8] ip[12]
44 movdqa xmm3, xmm4 ;ip[4] ip[0]
46 paddw xmm4, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1
47 psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1
50 punpcklqdq xmm4, xmm3 ;d1 a1
51 punpckhqdq xmm5, xmm3 ;c1 b1
53 movdqa xmm1, xmm5 ;c1 b1
54 paddw xmm5, xmm4 ;dl+cl a1+b1 aka op[4] op[0]
55 psubw xmm4, xmm1 ;d1-c1 a1-b1 aka op[12] op[8]
56 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 ; 13 12 11 10 03 02 01 00
59 ; 33 32 31 30 23 22 21 20
61 movdqa xmm0, xmm5 ; 13 12 11 10 03 02 01 00
62 punpcklwd xmm5, xmm4 ; 23 03 22 02 21 01 20 00
63 punpckhwd xmm0, xmm4 ; 33 13 32 12 31 11 30 10
64 movdqa xmm1, xmm5 ; 23 03 22 02 21 01 20 00
65 punpcklwd xmm5, xmm0 ; 31 21 11 01 30 20 10 00
66 punpckhwd xmm1, xmm0 ; 33 23 13 03 32 22 12 02
67 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 pshufd xmm2, xmm1, 4eh ;ip[8] ip[12]
69 movdqa xmm3, xmm5 ;ip[4] ip[0]
71 paddw xmm5, xmm2 ;ip[4]+ip[8] ip[0]+ip[12] aka b1 a1
72 psubw xmm3, xmm2 ;ip[4]-ip[8] ip[0]-ip[12] aka c1 d1
75 punpcklqdq xmm5, xmm3 ;d1 a1
76 punpckhqdq xmm6, xmm3 ;c1 b1
78 movdqa xmm1, xmm6 ;c1 b1
79 paddw xmm6, xmm5 ;dl+cl a1+b1 aka op[4] op[0]
80 psubw xmm5, xmm1 ;d1-c1 a1-b1 aka op[12] op[8]
82 movdqa xmm0, xmm6 ;aka b2 a2
83 movdqa xmm1, xmm5 ;aka d2 c2
110 movdqu [rdi + 0], xmm6
111 movdqu [rdi + 16], xmm5