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_covariance_matrix_calc_armv7 25 26 27ixheaacd_covariance_matrix_calc_armv7: 28 29 STMFD sp!, {r4-r12, r14} 30 MOVS r12, r2 31 BLE EXIT 32AUTOCORR: 33 MOV r12, r0 34 35 MOV r5, #9728 36 LDR r4, [r12, r5] 37 ADD r5, r5, #256 38 LDR r3, [r12, r5] 39 40 LDR r6, [r12], #256 41 LDR r5, [r12], #256 42 43 MOV r4, r4, ASR #3 44 MOV r3, r3, ASR #3 45 MOV r6, r6, ASR #3 46 MOV r5, r5, ASR #3 47 48 SMULWT r11, r3, r4 49 SMULWT r9, r5, r6 50 51 SMULWT r14, r4, r4 52 SUB r11, r9, r11 53 54 55 SMULWT r9, r6, r6 56 57 58 MOV r3, #12 59 60 SUB r14, r9, r14 61 62 MOV r7, #0 63 MOV r8, #0 64 MOV r9, #0 65 66AUTO_CORR_RIGHT: 67 LDR r4, [r12], #256 68 LDR r10, [r12], #256 69 70 MOV r4, r4, ASR #3 71 SMLAWT r9, r5, r5, r9 72 SMLAWT r7, r4, r5, r7 73 SMLAWT r8, r4, r6, r8 74 75 MOV r6, r10, ASR #3 76 SMLAWT r9, r4, r4, r9 77 SMLAWT r8, r6, r5, r8 78 79 LDR r5, [r12], #256 80 SMLAWT r7, r6, r4, r7 81 82 83 MOV r5, r5, ASR #3 84 SMLAWT r9, r6, r6, r9 85 SMLAWT r7, r5, r6, r7 86 SMLAWT r8, r5, r4, r8 87 88 SUBS r3, r3, #1 89 BNE AUTO_CORR_RIGHT 90 91 LDR r4, [r12], #256 92 MOV r4, r4, ASR #3 93 SMLAWT r9, r5, r5, r9 94 SMLAWT r7, r4, r5, r7 95 SMLAWT r8, r4, r6, r8 96 97 LDR r6, [r12], #256 98 MOV r6, r6, ASR #3 99 SMLAWT r9, r4, r4, r9 100 SMLAWT r7, r6, r4, r7 101 SMLAWT r8, r6, r5, r8 102 103CAL_AUTOCORR: 104 105 ADD r12, r7, r11 106 ADD r14, r9, r14 107 108 EOR r5, r7, r7, ASR #31 109 EOR r6, r8, r8, ASR #31 110 111 ORR r5, r6, r5 112 EOR r6, r12, r12, ASR #31 113 ORR r5, r6, r5 114 115 ORR r5, r9, r5 116 ORR r5, r14, r5 117 118 CLZ r5, r5 119 SUB r5, r5, #1 120 121 MOV r7, r7, LSL r5 122 MOV r8, r8, LSL r5 123 MOV r9, r9, LSL r5 124 MOV r12, r12, LSL r5 125 MOV r14, r14, LSL r5 126 127 128 STR r9, [r1], #4 129 STR r14, [r1], #4 130 STR r7, [r1], #4 131 132 133 SMULL r6, r5, r9, r14 134 SMULL r6, r10, r12, r12 135 136 STR r8, [r1], #4 137 STR r12, [r1], #4 138 139 QSUB r10, r5, r10 140 ADD r0, r0, #4 141 142 ADD r1, r1, #12 143 144 STR r10, [r1], #4 145 146 147 SUBS r2, r2, #1 148 BNE AUTOCORR 149 150 151EXIT: 152 153 LDMFD sp!, {r4-r12, r15} 154 155 156