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 .globl vp8_subtract_mbuv_ppc
13 .globl vp8_subtract_mby_ppc
16 ;# r4 unsigned char *usrc
17 ;# r5 unsigned char *vsrc
18 ;# r6 unsigned char *pred
20 vp8_subtract_mbuv_ppc:
21 mfspr r11
, 256 ;# get old VRSAVE
23 mtspr
256, r12
;# set VRSAVE
37 lvsl v5
, 0, r4
;# permutate value for alignment
46 vmrghb v3
, v0
, v1
;# unpack high src to short
47 vmrghb v4
, v0
, v2
;# unpack high pred to short
49 lvsl v5
, 0, r4
;# permutate value for alignment
56 stvx v3
, 0, r3
;# store out diff
60 vmrghb v3
, v0
, v1
;# unpack high src to short
61 vmrglb v4
, v0
, v2
;# unpack high pred to short
65 stvx v3
, r10
, r3
;# store out diff
74 lvsl v5
, 0, r5
;# permutate value for alignment
83 vmrghb v3
, v0
, v1
;# unpack high src to short
84 vmrghb v4
, v0
, v2
;# unpack high pred to short
86 lvsl v5
, 0, r5
;# permutate value for alignment
93 stvx v3
, 0, r3
;# store out diff
97 vmrghb v3
, v0
, v1
;# unpack high src to short
98 vmrglb v4
, v0
, v2
;# unpack high pred to short
102 stvx v3
, r10
, r3
;# store out diff
108 mtspr
256, r11
;# reset old VRSAVE
113 ;# r4 unsigned char *src
114 ;# r5 unsigned char *pred
116 vp8_subtract_mby_ppc:
117 mfspr r11
, 256 ;# get old VRSAVE
118 oris r12
, r11
, 0xf800
119 mtspr
256, r12
;# set VRSAVE
128 lvx v2
, 0, r5
;# pred
133 vmrghb v3
, v0
, v1
;# unpack high src to short
134 vmrghb v4
, v0
, v2
;# unpack high pred to short
138 stvx v3
, 0, r3
;# store out diff
140 vmrglb v3
, v0
, v1
;# unpack low src to short
141 vmrglb v4
, v0
, v2
;# unpack low pred to short
145 stvx v3
, r10
, r3
;# store out diff
151 mtspr
256, r11
;# reset old VRSAVE