xref: /aosp_15_r20/external/libxaac/decoder/armv8/ixheaacd_no_lap1.s (revision 15dc779a375ca8b5125643b829a8aa4b70d7f451)
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.macro push_v_regs
23    stp             q8, q9, [sp, #-32]!
24    stp             q10, q11, [sp, #-32]!
25    stp             q12, q13, [sp, #-32]!
26    stp             q14, q15, [sp, #-32]!
27    stp             X8, X9, [sp, #-16]!
28    stp             X10, X11, [sp, #-16]!
29    stp             X12, X13, [sp, #-16]!
30    stp             X14, X15, [sp, #-16]!
31    stp             X16, X17, [sp, #-16]!
32    stp             X29, X30, [sp, #-16]!
33.endm
34.macro pop_v_regs
35    ldp             X29, X30, [sp], #16
36    ldp             X16, X17, [sp], #16
37    ldp             X14, X15, [sp], #16
38    ldp             X12, X13, [sp], #16
39    ldp             X10, X11, [sp], #16
40    ldp             X8, X9, [sp], #16
41    ldp             q14, q15, [sp], #32
42    ldp             q12, q13, [sp], #32
43    ldp             q10, q11, [sp], #32
44    ldp             q8, q9, [sp], #32
45.endm
46.text
47.global ixheaacd_neg_shift_spec_armv8
48ixheaacd_neg_shift_spec_armv8:
49    push_v_regs
50    MOV             X5, #448
51    SUB             X6, X5, #1
52    LSL             X6, X6, #2
53    ADD             X6, X6, X0
54    MOV             X8, #-16
55    SUB             X6, X6, #12
56    LSL             X7, X3, #2
57    DUP             V31.4S, W2
58
59
60    LD1             {V0.4S}, [X6], X8
61    SQNEG           V0.4S, V0.4S
62
63    LD1             {V6.4S}, [X6], X8
64    SQSHL           V25.4S, V0.4S, V31.4S
65
66    REV64           V25.4S, V25.4S
67    SUB             X5, X5, #8
68
69    SQNEG           V29.4S, V6.4S
70
71LOOP_1:
72
73    ST1             {V25.S}[2], [X1], X7
74    SQSHL           V22.4S, V29.4S, V31.4S
75    LD1             {V0.4S}, [X6], X8
76    ST1             {V25.S}[3], [X1], X7
77    ST1             {V25.S}[0], [X1], X7
78    SQNEG           V0.4S, V0.4S
79    ST1             {V25.S}[1], [X1], X7
80    REV64           V22.4S, V22.4S
81    SUBS            X5, X5, #8
82
83
84    SQSHL           V25.4S, V0.4S, V31.4S
85    ST1             {V22.S}[2], [X1], X7
86    LD1             {V6.4S}, [X6], X8
87    ST1             {V22.S}[3], [X1], X7
88    ST1             {V22.S}[0], [X1], X7
89    REV64           V25.4S, V25.4S
90    ST1             {V22.S}[1], [X1], X7
91
92
93    SQNEG           V29.4S, V6.4S
94
95    BGT             LOOP_1
96
97    ST1             {V25.S}[2], [X1], X7
98    SQSHL           V22.4S, V29.4S, V31.4S
99    ST1             {V25.S}[3], [X1], X7
100    ST1             {V25.S}[0], [X1], X7
101
102    ST1             {V25.S}[1], [X1], X7
103
104    REV64            V22.4S, V22.4S
105
106
107    ST1             {V22.S}[2], [X1], X7
108    ST1             {V22.S}[3], [X1], X7
109    ST1             {V22.S}[0], [X1], X7
110    ST1             {V22.S}[1], [X1], X7
111    pop_v_regs
112    RET
113