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        .code 32
23       .eabi_attribute 24, 1            @Tag_ABI_align_needed
24       .eabi_attribute 25, 1            @Tag_ABI_align_preserved
25.text
26.p2align 2
27        .global ixheaacd_shiftrountine
28ixheaacd_shiftrountine:
29    CMP             r3, #0
30    STMFD           sp!, {r4-r7, r12}
31    MOV             r12, #0x1f
32    BGE             SROUTINE_L1
33    RSB             r3, r3, #0
34    CMP             r3, r12
35    MOVGT           r3, r12
36    SUBS            r2, r2, #2
37@    LDMMIFD     sp!, {r4-r7, r12}
38    LDMFDMI         sp!, {r4-r7, r12}
39    BXMI            lr
40SROUTINE_L2:
41    LDR             r12, [r0, #0]
42    LDR             r4, [r1, #0]
43    MOV             r12, r12, ASR r3
44    MOV             r4, r4, ASR r3
45    STR             r12, [r0], #4
46    STR             r4, [r1], #4
47
48    LDR             r12, [r0, #0]
49    LDR             r4, [r1, #0]
50    MOV             r12, r12, ASR r3
51    MOV             r4, r4, ASR r3
52    SUBS            r2, r2, #2
53    STR             r12, [r0], #4
54    STR             r4, [r1], #4
55
56    BPL             SROUTINE_L2
57    LDMFD           sp!, {r4-r7, r12}
58    BX              lr
59SROUTINE_L1:
60    SUBS            r4, r2, #2
61    RSB             r2, r3, #0x1f
62@    LDMMIFD     sp!, {r4-r7, r12}
63    LDMFDMI         sp!, {r4-r7, r12}
64    BXMI            lr
65SROUTINE_L3:
66    LDR             r12, [r0, #0]
67    LDR             r5, [r1, #0]
68
69    MOVS            r7, r12, ASR r2
70    CMNLT           r7, #1
71    MOVLT           r6, #0x80000000
72    MVNGT           r6, #0x80000000
73    MOVEQ           r6, r12, LSL r3
74
75    MOVS            r7, r5, ASR r2
76    CMNLT           r7, #1
77    MOVLT           r12, #0x80000000
78    MVNGT           r12, #0x80000000
79    MOVEQ           r12, r5, LSL r3
80    STR             r6, [r0], #4
81    STR             r12, [r1], #4
82
83    LDR             r12, [r0, #0]
84    LDR             r5, [r1, #0]
85
86    MOVS            r7, r12, ASR r2
87    CMNLT           r7, #1
88    MOVLT           r6, #0x80000000
89    MVNGT           r6, #0x80000000
90    MOVEQ           r6, r12, LSL r3
91
92    MOVS            r7, r5, ASR r2
93    CMNLT           r7, #1
94    MOVLT           r12, #0x80000000
95    MVNGT           r12, #0x80000000
96    MOVEQ           r12, r5, LSL r3
97    SUBS            r4, r4, #2
98    STR             r6, [r0], #4
99    STR             r12, [r1], #4
100
101    BPL             SROUTINE_L3
102    LDMFD           sp!, {r4-r7, r12}
103    BX              lr
104
105
106