1 @/* 2 @ ** Copyright 2003-2010, VisualOn, Inc. 3 @ ** 4 @ ** Licensed under the Apache License, Version 2.0 (the "License"); 5 @ ** you may not use this file except in compliance with the License. 6 @ ** You may obtain a copy of the License at 7 @ ** 8 @ ** http://www.apache.org/licenses/LICENSE-2.0 9 @ ** 10 @ ** Unless required by applicable law or agreed to in writing, software 11 @ ** distributed under the License is distributed on an "AS IS" BASIS, 12 @ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 @ ** See the License for the specific language governing permissions and 14 @ ** limitations under the License. 15 @ */ 16 @ 17 @void Pred_lt4( 18 @ Word16 exc[], /* in/out: excitation buffer */ 19 @ Word16 T0, /* input : integer pitch lag */ 20 @ Word16 frac, /* input : fraction of lag */ 21 @ Word16 L_subfr /* input : subframe size */ 22 @ ) 23 24 @****************************** 25 @ ARM Register 26 @****************************** 27 @ r0 --- exc[] 28 @ r1 --- T0 29 @ r2 --- frac 30 @ r3 --- L_subfr 31 32 .section .text 33 .global pred_lt4_asm 34 .extern inter4_2 35 .hidden inter4_2 36 37 pred_lt4_asm: 38 39 STMFD r13!, {r4 - r12, r14} 40 RSB r4, r1, #0 @-T0 41 RSB r2, r2, #0 @frac = -frac 42 ADD r5, r0, r4, LSL #1 @x = exc - T0 43 CMP r2, #0 44 ADDLT r2, r2, #4 @frac += UP_SAMP 45 SUBLT r5, r5, #2 @x-- 46 SUB r5, r5, #30 @x -= 15 47 RSB r4, r2, #3 @k = 3 - frac 48 ADR r8, Table 49 NOP @space for fixed up relative address of ADR 50 LDR r6, [r8] 51 ADD r6, r8 52 MOV r8, r4, LSL #6 53 @MOV r7, #0 @j = 0 54 ADD r8, r6, r8 @ptr2 = &(inter4_2[k][0]) 55 56 MOV r1, r5 57 MOV r5, #0x8000 58 MOV r14, #21 59 @ used register 60 @r0 --- exc[] r1 --- x r7 --- j r8 --- ptr2 r5 --- 0x8000 61 THREE_LOOP: 62 63 @MOV r1, r5 @ptr1 = x 64 MOV r2, r8 @ptr = ptr2 65 LDR r3, [r2], #4 @h[0], h[1] 66 LDRSH r4, [r1], #2 @x[0] 67 LDRSH r6, [r1], #2 @x[1] 68 LDRSH r9, [r1], #2 @x[2] 69 70 SMULBB r10, r4, r3 @x[0] * h[0] 71 SMULBB r11, r6, r3 @x[1] * h[0] 72 SMULBB r12, r9, r3 @x[2] * h[0] 73 74 LDRSH r4, [r1], #2 @x[3] 75 SMLABT r10, r6, r3, r10 @x[1] * h[1] 76 SMLABT r11, r9, r3, r11 @x[2] * h[1] 77 SMLABT r12, r4, r3, r12 @x[3] * h[1] 78 79 LDR r3, [r2], #4 @h[2], h[3] 80 LDRSH r6, [r1], #2 @x[4] 81 SMLABB r10, r9, r3, r10 @x[2] * h[2] 82 SMLABB r11, r4, r3, r11 @x[3] * h[2] 83 SMLABB r12, r6, r3, r12 @x[4] * h[2] 84 85 LDRSH r9, [r1], #2 @x[5] 86 SMLABT r10, r4, r3, r10 @x[3] * h[3] 87 SMLABT r11, r6, r3, r11 @x[4] * h[3] 88 SMLABT r12, r9, r3, r12 @x[5] * h[3] 89 90 LDR r3, [r2], #4 @h[4], h[5] 91 LDRSH r4, [r1], #2 @x[6] 92 SMLABB r10, r6, r3, r10 @x[4] * h[4] 93 SMLABB r11, r9, r3, r11 @x[5] * h[4] 94 SMLABB r12, r4, r3, r12 @x[6] * h[4] 95 96 LDRSH r6, [r1], #2 @x[7] 97 SMLABT r10, r9, r3, r10 @x[5] * h[5] 98 SMLABT r11, r4, r3, r11 @x[6] * h[5] 99 SMLABT r12, r6, r3, r12 @x[7] * h[5] 100 101 LDR r3, [r2], #4 @h[6], h[7] 102 LDRSH r9, [r1], #2 @x[8] 103 SMLABB r10, r4, r3, r10 @x[6] * h[6] 104 SMLABB r11, r6, r3, r11 @x[7] * h[6] 105 SMLABB r12, r9, r3, r12 @x[8] * h[6] 106 107 LDRSH r4, [r1], #2 @x[9] 108 SMLABT r10, r6, r3, r10 @x[7] * h[7] 109 SMLABT r11, r9, r3, r11 @x[8] * h[7] 110 SMLABT r12, r4, r3, r12 @x[9] * h[7] 111 112 LDR r3, [r2], #4 @h[8], h[9] 113 LDRSH r6, [r1], #2 @x[10] 114 SMLABB r10, r9, r3, r10 @x[8] * h[8] 115 SMLABB r11, r4, r3, r11 @x[9] * h[8] 116 SMLABB r12, r6, r3, r12 @x[10] * h[8] 117 118 LDRSH r9, [r1], #2 @x[11] 119 SMLABT r10, r4, r3, r10 @x[9] * h[9] 120 SMLABT r11, r6, r3, r11 @x[10] * h[9] 121 SMLABT r12, r9, r3, r12 @x[11] * h[9] 122 123 LDR r3, [r2], #4 @h[10], h[11] 124 LDRSH r4, [r1], #2 @x[12] 125 SMLABB r10, r6, r3, r10 @x[10] * h[10] 126 SMLABB r11, r9, r3, r11 @x[11] * h[10] 127 SMLABB r12, r4, r3, r12 @x[12] * h[10] 128 129 LDRSH r6, [r1], #2 @x[13] 130 SMLABT r10, r9, r3, r10 @x[11] * h[11] 131 SMLABT r11, r4, r3, r11 @x[12] * h[11] 132 SMLABT r12, r6, r3, r12 @x[13] * h[11] 133 134 LDR r3, [r2], #4 @h[12], h[13] 135 LDRSH r9, [r1], #2 @x[14] 136 SMLABB r10, r4, r3, r10 @x[12] * h[12] 137 SMLABB r11, r6, r3, r11 @x[13] * h[12] 138 SMLABB r12, r9, r3, r12 @x[14] * h[12] 139 140 LDRSH r4, [r1], #2 @x[15] 141 SMLABT r10, r6, r3, r10 @x[13] * h[13] 142 SMLABT r11, r9, r3, r11 @x[14] * h[13] 143 SMLABT r12, r4, r3, r12 @x[15] * h[13] 144 145 LDR r3, [r2], #4 @h[14], h[15] 146 LDRSH r6, [r1], #2 @x[16] 147 SMLABB r10, r9, r3, r10 @x[14] * h[14] 148 SMLABB r11, r4, r3, r11 @x[15] * h[14] 149 SMLABB r12, r6, r3, r12 @x[16] * h[14] 150 151 LDRSH r9, [r1], #2 @x[17] 152 SMLABT r10, r4, r3, r10 @x[15] * h[15] 153 SMLABT r11, r6, r3, r11 @x[16] * h[15] 154 SMLABT r12, r9, r3, r12 @x[17] * h[15] 155 156 LDR r3, [r2], #4 @h[16], h[17] 157 LDRSH r4, [r1], #2 @x[18] 158 SMLABB r10, r6, r3, r10 @x[16] * h[16] 159 SMLABB r11, r9, r3, r11 @x[17] * h[16] 160 SMLABB r12, r4, r3, r12 @x[18] * h[16] 161 162 LDRSH r6, [r1], #2 @x[19] 163 SMLABT r10, r9, r3, r10 @x[17] * h[17] 164 SMLABT r11, r4, r3, r11 @x[18] * h[17] 165 SMLABT r12, r6, r3, r12 @x[19] * h[17] 166 167 LDR r3, [r2], #4 @h[18], h[19] 168 LDRSH r9, [r1], #2 @x[20] 169 SMLABB r10, r4, r3, r10 @x[18] * h[18] 170 SMLABB r11, r6, r3, r11 @x[19] * h[18] 171 SMLABB r12, r9, r3, r12 @x[20] * h[18] 172 173 LDRSH r4, [r1], #2 @x[21] 174 SMLABT r10, r6, r3, r10 @x[19] * h[19] 175 SMLABT r11, r9, r3, r11 @x[20] * h[19] 176 SMLABT r12, r4, r3, r12 @x[21] * h[19] 177 178 LDR r3, [r2], #4 @h[20], h[21] 179 LDRSH r6, [r1], #2 @x[22] 180 SMLABB r10, r9, r3, r10 @x[20] * h[20] 181 SMLABB r11, r4, r3, r11 @x[21] * h[20] 182 SMLABB r12, r6, r3, r12 @x[22] * h[20] 183 184 LDRSH r9, [r1], #2 @x[23] 185 SMLABT r10, r4, r3, r10 @x[21] * h[21] 186 SMLABT r11, r6, r3, r11 @x[22] * h[21] 187 SMLABT r12, r9, r3, r12 @x[23] * h[21] 188 189 LDR r3, [r2], #4 @h[22], h[23] 190 LDRSH r4, [r1], #2 @x[24] 191 SMLABB r10, r6, r3, r10 @x[22] * h[22] 192 SMLABB r11, r9, r3, r11 @x[23] * h[22] 193 SMLABB r12, r4, r3, r12 @x[24] * h[22] 194 195 LDRSH r6, [r1], #2 @x[25] 196 SMLABT r10, r9, r3, r10 @x[23] * h[23] 197 SMLABT r11, r4, r3, r11 @x[24] * h[23] 198 SMLABT r12, r6, r3, r12 @x[25] * h[23] 199 200 LDR r3, [r2], #4 @h[24], h[25] 201 LDRSH r9, [r1], #2 @x[26] 202 SMLABB r10, r4, r3, r10 @x[24] * h[24] 203 SMLABB r11, r6, r3, r11 @x[25] * h[24] 204 SMLABB r12, r9, r3, r12 @x[26] * h[24] 205 206 LDRSH r4, [r1], #2 @x[27] 207 SMLABT r10, r6, r3, r10 @x[25] * h[25] 208 SMLABT r11, r9, r3, r11 @x[26] * h[25] 209 SMLABT r12, r4, r3, r12 @x[27] * h[25] 210 211 LDR r3, [r2], #4 @h[26], h[27] 212 LDRSH r6, [r1], #2 @x[28] 213 SMLABB r10, r9, r3, r10 @x[26] * h[26] 214 SMLABB r11, r4, r3, r11 @x[27] * h[26] 215 SMLABB r12, r6, r3, r12 @x[28] * h[26] 216 217 LDRSH r9, [r1], #2 @x[29] 218 SMLABT r10, r4, r3, r10 @x[27] * h[27] 219 SMLABT r11, r6, r3, r11 @x[28] * h[27] 220 SMLABT r12, r9, r3, r12 @x[29] * h[27] 221 222 LDR r3, [r2], #4 @h[28], h[29] 223 LDRSH r4, [r1], #2 @x[30] 224 SMLABB r10, r6, r3, r10 @x[28] * h[28] 225 SMLABB r11, r9, r3, r11 @x[29] * h[28] 226 SMLABB r12, r4, r3, r12 @x[30] * h[28] 227 228 LDRSH r6, [r1], #2 @x[31] 229 SMLABT r10, r9, r3, r10 @x[29] * h[29] 230 SMLABT r11, r4, r3, r11 @x[30] * h[29] 231 SMLABT r12, r6, r3, r12 @x[31] * h[29] 232 233 LDR r3, [r2], #4 @h[30], h[31] 234 LDRSH r9, [r1], #2 @x[32] 235 SMLABB r10, r4, r3, r10 @x[30] * h[30] 236 SMLABB r11, r6, r3, r11 @x[31] * h[30] 237 SMLABB r12, r9, r3, r12 @x[32] * h[30] 238 239 LDRSH r4, [r1], #-60 @x[33] 240 SMLABT r10, r6, r3, r10 @x[31] * h[31] 241 SMLABT r11, r9, r3, r11 @x[32] * h[31] 242 SMLABT r12, r4, r3, r12 @x[33] * h[31] 243 244 @SSAT r10, #32, r10, LSL #2 245 @SSAT r11, #32, r11, LSL #2 246 @SSAT r12, #32, r12, LSL #2 247 248 MOV r10, r10, LSL #1 249 MOV r11, r11, LSL #1 250 MOV r12, r12, LSL #1 251 252 QADD r10, r10, r10 253 QADD r11, r11, r11 254 QADD r12, r12, r12 255 256 QADD r10, r10, r5 257 QADD r11, r11, r5 258 QADD r12, r12, r5 259 260 SUBS r14, r14, #1 261 262 MOV r10, r10, ASR #16 263 MOV r11, r11, ASR #16 264 MOV r12, r12, ASR #16 265 266 STRH r10, [r0], #2 267 STRH r11, [r0], #2 268 STRH r12, [r0], #2 269 BNE THREE_LOOP 270 271 MOV r2, r8 @ptr = ptr2 272 273 Last2LOOP: 274 275 LDR r3, [r2], #4 @h[0], h[1] 276 LDRSH r4, [r1], #2 @x[0] 277 LDRSH r6, [r1], #2 @x[1] 278 LDRSH r9, [r1], #2 @x[2] 279 280 SMULBB r10, r4, r3 @x[0] * h[0] 281 SMULBB r11, r6, r3 @x[1] * h[0] 282 283 SMLABT r10, r6, r3, r10 @x[1] * h[1] 284 SMLABT r11, r9, r3, r11 @x[2] * h[1] 285 286 LDR r3, [r2], #4 @h[2], h[3] 287 LDRSH r4, [r1], #2 @x[3] 288 LDRSH r6, [r1], #2 @x[4] 289 290 SMLABB r10, r9, r3, r10 @x[2] * h[2] 291 SMLABB r11, r4, r3, r11 @x[3] * h[2] 292 293 SMLABT r10, r4, r3, r10 @x[3] * h[3] 294 SMLABT r11, r6, r3, r11 @x[4] * h[3] 295 296 LDR r3, [r2], #4 @h[4], h[5] 297 LDRSH r9, [r1], #2 @x[5] 298 LDRSH r4, [r1], #2 @x[6] 299 300 SMLABB r10, r6, r3, r10 @x[4] * h[4] 301 SMLABB r11, r9, r3, r11 @x[5] * h[4] 302 303 SMLABT r10, r9, r3, r10 @x[5] * h[5] 304 SMLABT r11, r4, r3, r11 @x[6] * h[5] 305 306 LDR r3, [r2], #4 @h[6], h[7] 307 LDRSH r6, [r1], #2 @x[7] 308 LDRSH r9, [r1], #2 @x[8] 309 310 SMLABB r10, r4, r3, r10 @x[6] * h[6] 311 SMLABB r11, r6, r3, r11 @x[7] * h[6] 312 313 SMLABT r10, r6, r3, r10 @x[7] * h[7] 314 SMLABT r11, r9, r3, r11 @x[8] * h[7] 315 316 LDR r3, [r2], #4 @h[8], h[9] 317 LDRSH r4, [r1], #2 @x[9] 318 LDRSH r6, [r1], #2 @x[10] 319 320 SMLABB r10, r9, r3, r10 @x[8] * h[8] 321 SMLABB r11, r4, r3, r11 @x[9] * h[8] 322 323 SMLABT r10, r4, r3, r10 @x[9] * h[9] 324 SMLABT r11, r6, r3, r11 @x[10] * h[9] 325 326 LDR r3, [r2], #4 @h[10], h[11] 327 LDRSH r9, [r1], #2 @x[11] 328 LDRSH r4, [r1], #2 @x[12] 329 330 SMLABB r10, r6, r3, r10 @x[10] * h[10] 331 SMLABB r11, r9, r3, r11 @x[11] * h[10] 332 333 SMLABT r10, r9, r3, r10 @x[11] * h[11] 334 SMLABT r11, r4, r3, r11 @x[12] * h[11] 335 336 LDR r3, [r2], #4 @h[12], h[13] 337 LDRSH r6, [r1], #2 @x[13] 338 LDRSH r9, [r1], #2 @x[14] 339 340 SMLABB r10, r4, r3, r10 @x[12] * h[12] 341 SMLABB r11, r6, r3, r11 @x[13] * h[12] 342 343 SMLABT r10, r6, r3, r10 @x[13] * h[13] 344 SMLABT r11, r9, r3, r11 @x[14] * h[13] 345 346 LDR r3, [r2], #4 @h[14], h[15] 347 LDRSH r4, [r1], #2 @x[15] 348 LDRSH r6, [r1], #2 @x[16] 349 350 SMLABB r10, r9, r3, r10 @x[14] * h[14] 351 SMLABB r11, r4, r3, r11 @x[15] * h[14] 352 353 SMLABT r10, r4, r3, r10 @x[15] * h[15] 354 SMLABT r11, r6, r3, r11 @x[16] * h[15] 355 356 LDR r3, [r2], #4 @h[16], h[17] 357 LDRSH r9, [r1], #2 @x[17] 358 LDRSH r4, [r1], #2 @x[18] 359 360 SMLABB r10, r6, r3, r10 @x[16] * h[16] 361 SMLABB r11, r9, r3, r11 @x[17] * h[16] 362 363 SMLABT r10, r9, r3, r10 @x[17] * h[17] 364 SMLABT r11, r4, r3, r11 @x[18] * h[17] 365 366 LDR r3, [r2], #4 @h[18], h[19] 367 LDRSH r6, [r1], #2 @x[19] 368 LDRSH r9, [r1], #2 @x[20] 369 370 SMLABB r10, r4, r3, r10 @x[18] * h[18] 371 SMLABB r11, r6, r3, r11 @x[19] * h[18] 372 373 SMLABT r10, r6, r3, r10 @x[19] * h[19] 374 SMLABT r11, r9, r3, r11 @x[20] * h[19] 375 376 LDR r3, [r2], #4 @h[20], h[21] 377 LDRSH r4, [r1], #2 @x[21] 378 LDRSH r6, [r1], #2 @x[22] 379 380 SMLABB r10, r9, r3, r10 @x[20] * h[20] 381 SMLABB r11, r4, r3, r11 @x[21] * h[20] 382 383 SMLABT r10, r4, r3, r10 @x[21] * h[21] 384 SMLABT r11, r6, r3, r11 @x[22] * h[21] 385 386 LDR r3, [r2], #4 @h[22], h[23] 387 LDRSH r9, [r1], #2 @x[23] 388 LDRSH r4, [r1], #2 @x[24] 389 390 SMLABB r10, r6, r3, r10 @x[22] * h[22] 391 SMLABB r11, r9, r3, r11 @x[23] * h[22] 392 393 SMLABT r10, r9, r3, r10 @x[23] * h[23] 394 SMLABT r11, r4, r3, r11 @x[24] * h[23] 395 396 LDR r3, [r2], #4 @h[24], h[25] 397 LDRSH r6, [r1], #2 @x[25] 398 LDRSH r9, [r1], #2 @x[26] 399 400 SMLABB r10, r4, r3, r10 @x[24] * h[24] 401 SMLABB r11, r6, r3, r11 @x[25] * h[24] 402 403 SMLABT r10, r6, r3, r10 @x[25] * h[25] 404 SMLABT r11, r9, r3, r11 @x[26] * h[25] 405 406 LDR r3, [r2], #4 @h[26], h[27] 407 LDRSH r4, [r1], #2 @x[27] 408 LDRSH r6, [r1], #2 @x[28] 409 410 SMLABB r10, r9, r3, r10 @x[26] * h[26] 411 SMLABB r11, r4, r3, r11 @x[27] * h[26] 412 413 SMLABT r10, r4, r3, r10 @x[27] * h[27] 414 SMLABT r11, r6, r3, r11 @x[28] * h[27] 415 416 LDR r3, [r2], #4 @h[28], h[29] 417 LDRSH r9, [r1], #2 @x[29] 418 LDRSH r4, [r1], #2 @x[30] 419 420 SMLABB r10, r6, r3, r10 @x[28] * h[28] 421 SMLABB r11, r9, r3, r11 @x[29] * h[28] 422 423 SMLABT r10, r9, r3, r10 @x[29] * h[29] 424 SMLABT r11, r4, r3, r11 @x[30] * h[29] 425 426 LDR r3, [r2], #4 @h[30], h[31] 427 LDRSH r6, [r1], #2 @x[31] 428 LDRSH r9, [r1], #2 @x[32] 429 430 SMLABB r10, r4, r3, r10 @x[30] * h[30] 431 SMLABB r11, r6, r3, r11 @x[31] * h[30] 432 433 SMLABT r10, r6, r3, r10 @x[31] * h[31] 434 SMLABT r11, r9, r3, r11 @x[32] * h[31] 435 436 @SSAT r10, #32, r10, LSL #2 437 @SSAT r11, #32, r11, LSL #2 438 MOV r10, r10, LSL #1 439 MOV r11, r11, LSL #1 440 441 QADD r10, r10, r10 442 QADD r11, r11, r11 443 444 QADD r10, r10, r5 445 QADD r11, r11, r5 446 447 MOV r10, r10, ASR #16 448 MOV r11, r11, ASR #16 449 450 STRH r10, [r0], #2 451 STRH r11, [r0], #2 452 453 454 pred_lt4_end: 455 LDMFD r13!, {r4 - r12, r15} 456 457 Table: 458 .word inter4_2-Table 459 @ENDFUNC 460 .end 461 462 463 464 465