aboutsummaryrefslogtreecommitdiff
path: root/decoder/armv7/ixheaacd_shiftrountine.s
blob: 9958e14b2b77a7369b72b8c744850f80dc2d09ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
@/******************************************************************************
@ *
@ * Copyright (C) 2018 The Android Open Source Project
@ *
@ * Licensed under the Apache License, Version 2.0 (the "License");
@ * you may not use this file except in compliance with the License.
@ * You may obtain a copy of the License at:
@ *
@ * http://www.apache.org/licenses/LICENSE-2.0
@ *
@ * Unless required by applicable law or agreed to in writing, software
@ * distributed under the License is distributed on an "AS IS" BASIS,
@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ * See the License for the specific language governing permissions and
@ * limitations under the License.
@ *
@ *****************************************************************************
@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
@*/


        .code 32
       .eabi_attribute 24, 1            @Tag_ABI_align_needed
       .eabi_attribute 25, 1            @Tag_ABI_align_preserved
.text
.p2align 2
        .global ixheaacd_shiftrountine
ixheaacd_shiftrountine:
    CMP             r3, #0
    STMFD           sp!, {r4-r7, r12}
    MOV             r12, #0x1f
    BGE             SROUTINE_L1
    RSB             r3, r3, #0
    CMP             r3, r12
    MOVGT           r3, r12
    SUBS            r2, r2, #2
@    LDMMIFD     sp!, {r4-r7, r12}
    LDMFDMI         sp!, {r4-r7, r12}
    BXMI            lr
SROUTINE_L2:
    LDR             r12, [r0, #0]
    LDR             r4, [r1, #0]
    MOV             r12, r12, ASR r3
    MOV             r4, r4, ASR r3
    STR             r12, [r0], #4
    STR             r4, [r1], #4

    LDR             r12, [r0, #0]
    LDR             r4, [r1, #0]
    MOV             r12, r12, ASR r3
    MOV             r4, r4, ASR r3
    SUBS            r2, r2, #2
    STR             r12, [r0], #4
    STR             r4, [r1], #4

    BPL             SROUTINE_L2
    LDMFD           sp!, {r4-r7, r12}
    BX              lr
SROUTINE_L1:
    SUBS            r4, r2, #2
    RSB             r2, r3, #0x1f
@    LDMMIFD     sp!, {r4-r7, r12}
    LDMFDMI         sp!, {r4-r7, r12}
    BXMI            lr
SROUTINE_L3:
    LDR             r12, [r0, #0]
    LDR             r5, [r1, #0]

    MOVS            r7, r12, ASR r2
    CMNLT           r7, #1
    MOVLT           r6, #0x80000000
    MVNGT           r6, #0x80000000
    MOVEQ           r6, r12, LSL r3

    MOVS            r7, r5, ASR r2
    CMNLT           r7, #1
    MOVLT           r12, #0x80000000
    MVNGT           r12, #0x80000000
    MOVEQ           r12, r5, LSL r3
    STR             r6, [r0], #4
    STR             r12, [r1], #4

    LDR             r12, [r0, #0]
    LDR             r5, [r1, #0]

    MOVS            r7, r12, ASR r2
    CMNLT           r7, #1
    MOVLT           r6, #0x80000000
    MVNGT           r6, #0x80000000
    MOVEQ           r6, r12, LSL r3

    MOVS            r7, r5, ASR r2
    CMNLT           r7, #1
    MOVLT           r12, #0x80000000
    MVNGT           r12, #0x80000000
    MOVEQ           r12, r5, LSL r3
    SUBS            r4, r4, #2
    STR             r6, [r0], #4
    STR             r12, [r1], #4

    BPL             SROUTINE_L3
    LDMFD           sp!, {r4-r7, r12}
    BX              lr