• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@/******************************************************************************
2@ *
3@ * Copyright (C) 2018 The Android Open Source Project
4@ *
5@ * Licensed under the Apache License, Version 2.0 (the "License");
6@ * you may not use this file except in compliance with the License.
7@ * You may obtain a copy of the License at:
8@ *
9@ * http://www.apache.org/licenses/LICENSE-2.0
10@ *
11@ * Unless required by applicable law or agreed to in writing, software
12@ * distributed under the License is distributed on an "AS IS" BASIS,
13@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14@ * See the License for the specific language governing permissions and
15@ * limitations under the License.
16@ *
17@ *****************************************************************************
18@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19@*/
20
21
22.text
23.p2align 2
24.global ixheaacd_apply_rot_armv7
25
26ixheaacd_apply_rot_armv7:
27    STMFD           SP!, {R4-R12, R14}
28    MOVW            R5, #0x59e
29    MOV             R4, #22
30    ADD             R11, R0, R5
31LOOP1:
32    LDRSH           R5, [R11, #-98]
33    LDRSH           R6, [R11, #94]
34    LDRSH           R7, [R11, #-96]
35    LDRSH           R8, [R11, #96]
36    ADD             R9, R5, R6
37    STRH            R9, [R11, #-98]
38    ADD             R10, R7, R8
39    STRH            R10, [R11, #-96]
40
41
42    LDRSH           R5, [R11, #-2]
43    LDRSH           R6, [R11, #190]
44    LDRSH           R7, [R11]
45    LDRSH           R8, [R11, #192]
46    ADD             R9, R5, R6
47    STRH            R9, [R11, #-2]
48    ADD             R10, R7, R8
49    STRH            R10, [R11], #4
50
51    LDRSH           R5, [R11, #-98]
52    LDRSH           R6, [R11, #94]
53    LDRSH           R7, [R11, #-96]
54    LDRSH           R8, [R11, #96]
55    ADD             R9, R5, R6
56    STRH            R9, [R11, #-98]
57    ADD             R10, R7, R8
58    STRH            R10, [R11, #-96]
59
60    SUBS            R4, R4, #2
61
62    LDRSH           R5, [R11, #-2]
63    LDRSH           R6, [R11, #190]
64    LDRSH           R7, [R11]
65    LDRSH           R8, [R11, #192]
66    ADD             R9, R5, R6
67    STRH            R9, [R11, #-2]
68    ADD             R10, R7, R8
69    STRH            R10, [R11], #4
70
71    BGT             LOOP1
72
73    MOVW            R4, #0x53C
74    LDR             R12, [R0, #44]
75    ADD             R11, R0, R4
76    MOV             R4, #10
77
78LOOP2:
79
80    LDR             R5, [R12]
81    LDR             R7, [R11], #4
82    LDR             R6, [R12, #0x80]
83    LDR             R8, [R11, #92]
84
85    SMULWB          R9, R5, R7
86    SMULWB          R10, R6, R8
87    SMULWT          R14, R5, R7
88
89    QADD            R5, R9, R10
90    SMULWT          R6, R6, R8
91
92    MOV             R5, R5, LSL #2
93    QADD            R14, R14, R6
94    STR             R5, [R12], #4
95    MOV             R14, R14, LSL #2
96    STR             R14, [R12, #0x7c]
97
98    LDR             R5, [R12, #0x3c]
99    LDR             R6, [R12, #0xbc]
100
101    SMULWB          R9, R5, R7
102    SMULWB          R10, R6, R8
103    SMULWT          R14, R5, R7
104
105    QADD            R5, R9, R10
106
107    SMULWT          R6, R6, R8
108
109    MOV             R5, R5, LSL #2
110    QADD            R14, R14, R6
111    STR             R5, [R12, #0x3c]
112    MOV             R14, R14, LSL #2
113    STR             R14, [R12, #0xbc]
114
115    SUBS            R4, R4, #1
116
117    BGT             LOOP2
118
119    MOVW            R11, #0x6c2
120    MOVW            R5, #0x564
121    LDRSH           R14, [R0, R11]
122    ADD             R11, R0, R5
123    LDR             R5, [SP, #44]
124    SUB             SP, SP, #512
125    MOV             R12, SP
126    LDR             R6, [R5, #12]
127    MOV             R4, #12
128    ADD             R6, R6, #0xb8
129
130LOOP3:
131    LDRSH           R5, [R6], #2
132    LDRSH           R7, [R6, #-4]
133    LDR             R10, [R11, #96]
134    LDR             R9, [R11], #4
135    CMP             R14, R5
136    SUB             R8, R14, R7
137    SUBGT           R8, R5, R7
138    ADD             R5, R12, R7, LSL #3
139
140LOOP3INN1:
141    STR             R10, [R5, #4]
142    STR             R9, [R5], #8
143    SUBS            R8, R8, #1
144    BGT             LOOP3INN1
145
146    SUBS            R4, R4, #1
147    BGT             LOOP3
148
149    MOV             R4, #3
150    LDR             R12, [R0, #44]
151    LDR             R9, [SP, #48+512]
152    LDR             R0, [SP, #40+512]
153    STR             R14, [SP, #-4]!
154
155LOOP4:
156    LDR             R5, [R12], #4
157    LDR             R6, [R12, #0x3c]
158    LDR             R7, [R12, #0x7c]
159    LDRSH           R10, [R9], #2
160    LDR             R8, [R12, #0xbc]
161    MOV             R11, #5
162    CMP             R10, #6
163    SUBLT           R11, R10, #1
164
165LOOP4INN1:
166    LDR             R10, [R12], #4
167    LDR             R14, [R12, #0x3C]
168    QADD            R5, R5, R10
169    QADD            R6, R6, R14
170    LDR             R10, [R12, #0x7C]
171    LDR             R14, [R12, #0xBC]
172    QADD            R7, R7, R10
173    QADD            R8, R8, R14
174    SUBS            R11, R11, #1
175    BGT             LOOP4INN1
176
177    STR             R5, [R1], #4
178    STR             R6, [R2], #4
179    STR             R7, [R3], #4
180    STR             R8, [R0], #4
181    SUBS            R4, R4, #1
182    BGT             LOOP4
183
184    LDR             R14, [SP]
185    ADD             R11, SP, #28
186    SUB             R4, R14, #3
187
188LOOP5:
189    LDR             R5, [R1]
190    LDR             R7, [R11], #4
191    LDR             R6, [R3]
192    LDR             R8, [R11], #4
193
194    SMULWB          R9, R5, R7
195    SMULWB          R10, R6, R8
196    SMULWT          R14, R5, R7
197
198    QADD            R5, R9, R10
199    SMULWT          R6, R6, R8
200
201    MOV             R5, R5, LSL #2
202    QADD            R14, R14, R6
203    STR             R5, [R1], #4
204    MOV             R14, R14, LSL #2
205    STR             R14, [R3], #4
206
207    SUBS            R4, R4, #1
208
209    LDR             R5, [R2]
210    LDR             R6, [R0]
211
212    SMULWB          R9, R5, R7
213    SMULWB          R10, R6, R8
214    SMULWT          R14, R5, R7
215
216    QADD            R5, R9, R10
217
218    SMULWT          R6, R6, R8
219
220    MOV             R5, R5, LSL #2
221    QADD            R14, R14, R6
222    STR             R5, [R2], #4
223    MOV             R14, R14, LSL #2
224    STR             R14, [R0], #4
225
226    BGT             LOOP5
227    ADD             SP, SP, #516
228    LDMFD           sp!, {r4-r12, r15}
229
230