pred_lt4_1_opt.s 18.6 KB
Newer Older
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
@/*
@ ** Copyright 2003-2010, VisualOn, Inc.
@ **
@ ** 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.
@ */
@
@void Pred_lt4(
@		  Word16 exc[],                         /* in/out: excitation buffer */
@		  Word16 T0,                            /* input : integer pitch lag */
@		  Word16 frac,                          /* input : fraction of lag   */
@		  Word16 L_subfr                        /* input : subframe size     */
@	      )

@******************************
@       ARM Register
@******************************
@ r0  ---  exc[]
@ r1  ---  T0
@ r2  ---  frac
@ r3  ---  L_subfr

         .section  .text
	 .global   pred_lt4_asm
	 .extern   voAWB_inter4_2
35
	 .hidden   voAWB_inter4_2
36 37 38

pred_lt4_asm:

39
         STMFD     r13!, {r4 - r12, r14}
40 41 42 43 44 45 46 47
         RSB       r4, r1, #0                         @-T0
         RSB       r2, r2, #0                         @frac = -frac
         ADD       r5, r0, r4, LSL #1                 @x = exc - T0
         CMP       r2, #0
         ADDLT     r2, r2, #4                         @frac += UP_SAMP
         SUBLT     r5, r5, #2                         @x--
         SUB       r5, r5, #30                        @x -= 15
         RSB       r4, r2, #3                         @k = 3 - frac
48 49 50
         ADRL      r8, Table
         LDR       r6, [r8]
         ADD       r6, r8
51
	 MOV       r8, r4, LSL #6
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
         @MOV       r7, #0                             @j = 0
         ADD       r8, r6, r8                         @ptr2 = &(inter4_2[k][0])

	 MOV       r1, r5
	 MOV       r5, #0x8000
	 MOV       r14, #21
@ used register
         @r0 --- exc[]  r1 --- x  r7 --- j  r8 --- ptr2  r5 --- 0x8000
THREE_LOOP:

         @MOV       r1, r5                             @ptr1 = x
	 MOV       r2, r8                             @ptr = ptr2
         LDR       r3, [r2], #4                       @h[0], h[1]
	 LDRSH     r4, [r1], #2                       @x[0]
	 LDRSH     r6, [r1], #2                       @x[1]
	 LDRSH     r9, [r1], #2                       @x[2]

69
	 SMULBB    r10, r4, r3                        @x[0] * h[0]
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
	 SMULBB    r11, r6, r3                        @x[1] * h[0]
	 SMULBB    r12, r9, r3                        @x[2] * h[0]

         LDRSH     r4, [r1], #2                       @x[3]
	 SMLABT    r10, r6, r3, r10                   @x[1] * h[1]
         SMLABT    r11, r9, r3, r11                   @x[2] * h[1]
	 SMLABT    r12, r4, r3, r12                   @x[3] * h[1]

	 LDR       r3, [r2], #4                       @h[2], h[3]
	 LDRSH     r6, [r1], #2                       @x[4]
	 SMLABB    r10, r9, r3, r10                   @x[2] * h[2]
         SMLABB    r11, r4, r3, r11                   @x[3] * h[2]
         SMLABB    r12, r6, r3, r12                   @x[4] * h[2]

         LDRSH     r9, [r1], #2                       @x[5]
         SMLABT    r10, r4, r3, r10                   @x[3] * h[3]
         SMLABT    r11, r6, r3, r11                   @x[4] * h[3]
         SMLABT    r12, r9, r3, r12                   @x[5] * h[3]

         LDR       r3, [r2], #4                       @h[4], h[5]
         LDRSH     r4, [r1], #2                       @x[6]
         SMLABB    r10, r6, r3, r10                   @x[4] * h[4]
         SMLABB    r11, r9, r3, r11                   @x[5] * h[4]
         SMLABB    r12, r4, r3, r12                   @x[6] * h[4]

	 LDRSH     r6, [r1], #2                       @x[7]
	 SMLABT    r10, r9, r3, r10                   @x[5] * h[5]
	 SMLABT    r11, r4, r3, r11                   @x[6] * h[5]
	 SMLABT    r12, r6, r3, r12                   @x[7] * h[5]

         LDR       r3, [r2], #4                       @h[6], h[7]
	 LDRSH     r9, [r1], #2                       @x[8]
	 SMLABB    r10, r4, r3, r10                   @x[6] * h[6]
	 SMLABB    r11, r6, r3, r11                   @x[7] * h[6]
	 SMLABB    r12, r9, r3, r12                   @x[8] * h[6]

	 LDRSH     r4, [r1], #2                       @x[9]
	 SMLABT    r10, r6, r3, r10                   @x[7] * h[7]
	 SMLABT    r11, r9, r3, r11                   @x[8] * h[7]
	 SMLABT    r12, r4, r3, r12                   @x[9] * h[7]

	 LDR       r3, [r2], #4                       @h[8], h[9]
	 LDRSH     r6, [r1], #2                       @x[10]
	 SMLABB    r10, r9, r3, r10                   @x[8] * h[8]
	 SMLABB    r11, r4, r3, r11                   @x[9] * h[8]
	 SMLABB    r12, r6, r3, r12                   @x[10] * h[8]

	 LDRSH     r9, [r1], #2                       @x[11]
	 SMLABT    r10, r4, r3, r10                   @x[9] * h[9]
	 SMLABT    r11, r6, r3, r11                   @x[10] * h[9]
	 SMLABT    r12, r9, r3, r12                   @x[11] * h[9]

         LDR       r3, [r2], #4                       @h[10], h[11]
	 LDRSH     r4, [r1], #2                       @x[12]
         SMLABB    r10, r6, r3, r10                   @x[10] * h[10]
	 SMLABB    r11, r9, r3, r11                   @x[11] * h[10]
	 SMLABB    r12, r4, r3, r12                   @x[12] * h[10]

	 LDRSH     r6, [r1], #2                       @x[13]
	 SMLABT    r10, r9, r3, r10                   @x[11] * h[11]
	 SMLABT    r11, r4, r3, r11                   @x[12] * h[11]
	 SMLABT    r12, r6, r3, r12                   @x[13] * h[11]

	 LDR       r3, [r2], #4                       @h[12], h[13]
	 LDRSH     r9, [r1], #2                       @x[14]
	 SMLABB    r10, r4, r3, r10                   @x[12] * h[12]
	 SMLABB    r11, r6, r3, r11                   @x[13] * h[12]
	 SMLABB    r12, r9, r3, r12                   @x[14] * h[12]

	 LDRSH     r4, [r1], #2                       @x[15]
	 SMLABT    r10, r6, r3, r10                   @x[13] * h[13]
	 SMLABT    r11, r9, r3, r11                   @x[14] * h[13]
	 SMLABT    r12, r4, r3, r12                   @x[15] * h[13]

	 LDR       r3, [r2], #4                       @h[14], h[15]
	 LDRSH     r6, [r1], #2                       @x[16]
	 SMLABB    r10, r9, r3, r10                   @x[14] * h[14]
	 SMLABB    r11, r4, r3, r11                   @x[15] * h[14]
	 SMLABB    r12, r6, r3, r12                   @x[16] * h[14]

	 LDRSH     r9, [r1], #2                       @x[17]
         SMLABT    r10, r4, r3, r10                   @x[15] * h[15]
	 SMLABT    r11, r6, r3, r11                   @x[16] * h[15]
	 SMLABT    r12, r9, r3, r12                   @x[17] * h[15]

	 LDR       r3, [r2], #4                       @h[16], h[17]
	 LDRSH     r4, [r1], #2                       @x[18]
	 SMLABB    r10, r6, r3, r10                   @x[16] * h[16]
	 SMLABB    r11, r9, r3, r11                   @x[17] * h[16]
	 SMLABB    r12, r4, r3, r12                   @x[18] * h[16]

         LDRSH     r6, [r1], #2                       @x[19]
	 SMLABT    r10, r9, r3, r10                   @x[17] * h[17]
	 SMLABT    r11, r4, r3, r11                   @x[18] * h[17]
	 SMLABT    r12, r6, r3, r12                   @x[19] * h[17]

	 LDR       r3, [r2], #4                       @h[18], h[19]
         LDRSH     r9, [r1], #2                       @x[20]
	 SMLABB    r10, r4, r3, r10                   @x[18] * h[18]
	 SMLABB    r11, r6, r3, r11                   @x[19] * h[18]
	 SMLABB    r12, r9, r3, r12                   @x[20] * h[18]

	 LDRSH     r4, [r1], #2                       @x[21]
	 SMLABT    r10, r6, r3, r10                   @x[19] * h[19]
	 SMLABT    r11, r9, r3, r11                   @x[20] * h[19]
	 SMLABT    r12, r4, r3, r12                   @x[21] * h[19]

	 LDR       r3, [r2], #4                       @h[20], h[21]
	 LDRSH     r6, [r1], #2                       @x[22]
	 SMLABB    r10, r9, r3, r10                   @x[20] * h[20]
	 SMLABB    r11, r4, r3, r11                   @x[21] * h[20]
	 SMLABB    r12, r6, r3, r12                   @x[22] * h[20]

	 LDRSH     r9, [r1], #2                       @x[23]
	 SMLABT    r10, r4, r3, r10                   @x[21] * h[21]
	 SMLABT    r11, r6, r3, r11                   @x[22] * h[21]
	 SMLABT    r12, r9, r3, r12                   @x[23] * h[21]

	 LDR       r3, [r2], #4                       @h[22], h[23]
	 LDRSH     r4, [r1], #2                       @x[24]
	 SMLABB    r10, r6, r3, r10                   @x[22] * h[22]
	 SMLABB    r11, r9, r3, r11                   @x[23] * h[22]
	 SMLABB    r12, r4, r3, r12                   @x[24] * h[22]

         LDRSH     r6, [r1], #2                       @x[25]
	 SMLABT    r10, r9, r3, r10                   @x[23] * h[23]
	 SMLABT    r11, r4, r3, r11                   @x[24] * h[23]
	 SMLABT    r12, r6, r3, r12                   @x[25] * h[23]

	 LDR       r3, [r2], #4                       @h[24], h[25]
         LDRSH     r9, [r1], #2                       @x[26]
	 SMLABB    r10, r4, r3, r10                   @x[24] * h[24]
	 SMLABB    r11, r6, r3, r11                   @x[25] * h[24]
	 SMLABB    r12, r9, r3, r12                   @x[26] * h[24]

	 LDRSH     r4, [r1], #2                       @x[27]
	 SMLABT    r10, r6, r3, r10                   @x[25] * h[25]
	 SMLABT    r11, r9, r3, r11                   @x[26] * h[25]
	 SMLABT    r12, r4, r3, r12                   @x[27] * h[25]

	 LDR       r3, [r2], #4                       @h[26], h[27]
	 LDRSH     r6, [r1], #2                       @x[28]
	 SMLABB    r10, r9, r3, r10                   @x[26] * h[26]
	 SMLABB    r11, r4, r3, r11                   @x[27] * h[26]
	 SMLABB    r12, r6, r3, r12                   @x[28] * h[26]

	 LDRSH     r9, [r1], #2                       @x[29]
	 SMLABT    r10, r4, r3, r10                   @x[27] * h[27]
	 SMLABT    r11, r6, r3, r11                   @x[28] * h[27]
	 SMLABT    r12, r9, r3, r12                   @x[29] * h[27]

	 LDR       r3, [r2], #4                       @h[28], h[29]
	 LDRSH     r4, [r1], #2                       @x[30]
	 SMLABB    r10, r6, r3, r10                   @x[28] * h[28]
	 SMLABB    r11, r9, r3, r11                   @x[29] * h[28]
	 SMLABB    r12, r4, r3, r12                   @x[30] * h[28]

         LDRSH     r6, [r1], #2                       @x[31]
	 SMLABT    r10, r9, r3, r10                   @x[29] * h[29]
	 SMLABT    r11, r4, r3, r11                   @x[30] * h[29]
	 SMLABT    r12, r6, r3, r12                   @x[31] * h[29]

	 LDR       r3, [r2], #4                       @h[30], h[31]
         LDRSH     r9, [r1], #2                       @x[32]
	 SMLABB    r10, r4, r3, r10                   @x[30] * h[30]
	 SMLABB    r11, r6, r3, r11                   @x[31] * h[30]
	 SMLABB    r12, r9, r3, r12                   @x[32] * h[30]

	 LDRSH     r4, [r1], #-60                     @x[33]
	 SMLABT    r10, r6, r3, r10                   @x[31] * h[31]
	 SMLABT    r11, r9, r3, r11                   @x[32] * h[31]
	 SMLABT    r12, r4, r3, r12                   @x[33] * h[31]

	 @SSAT      r10, #32, r10, LSL #2
	 @SSAT      r11, #32, r11, LSL #2
	 @SSAT      r12, #32, r12, LSL #2

	 MOV       r10, r10, LSL #1
	 MOV       r11, r11, LSL #1
	 MOV       r12, r12, LSL #1

	 QADD      r10, r10, r10
	 QADD      r11, r11, r11
	 QADD      r12, r12, r12

	 QADD      r10, r10, r5
	 QADD      r11, r11, r5
	 QADD      r12, r12, r5

	 SUBS      r14, r14, #1

	 MOV       r10, r10, ASR #16
	 MOV       r11, r11, ASR #16
	 MOV       r12, r12, ASR #16

	 STRH      r10, [r0], #2
	 STRH      r11, [r0], #2
	 STRH      r12, [r0], #2
	 BNE       THREE_LOOP

	 MOV       r2, r8                             @ptr = ptr2

Last2LOOP:

         LDR       r3, [r2], #4                       @h[0], h[1]
	 LDRSH     r4, [r1], #2                       @x[0]
	 LDRSH     r6, [r1], #2                       @x[1]
	 LDRSH     r9, [r1], #2                       @x[2]

	 SMULBB    r10, r4, r3                        @x[0] * h[0]
	 SMULBB    r11, r6, r3                        @x[1] * h[0]

	 SMLABT    r10, r6, r3, r10                   @x[1] * h[1]
	 SMLABT    r11, r9, r3, r11                   @x[2] * h[1]

	 LDR       r3, [r2], #4                       @h[2], h[3]
	 LDRSH     r4, [r1], #2                       @x[3]
         LDRSH     r6, [r1], #2                       @x[4]

	 SMLABB    r10, r9, r3, r10                   @x[2] * h[2]
         SMLABB    r11, r4, r3, r11                   @x[3] * h[2]
291

292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
	 SMLABT    r10, r4, r3, r10                   @x[3] * h[3]
	 SMLABT    r11, r6, r3, r11                   @x[4] * h[3]

	 LDR       r3, [r2], #4                       @h[4], h[5]
	 LDRSH     r9, [r1], #2                       @x[5]
	 LDRSH     r4, [r1], #2                       @x[6]

	 SMLABB    r10, r6, r3, r10                   @x[4] * h[4]
	 SMLABB    r11, r9, r3, r11                   @x[5] * h[4]

	 SMLABT    r10, r9, r3, r10                   @x[5] * h[5]
	 SMLABT    r11, r4, r3, r11                   @x[6] * h[5]

	 LDR       r3, [r2], #4                       @h[6], h[7]
	 LDRSH     r6, [r1], #2                       @x[7]
	 LDRSH     r9, [r1], #2                       @x[8]

	 SMLABB    r10, r4, r3, r10                   @x[6] * h[6]
	 SMLABB    r11, r6, r3, r11                   @x[7] * h[6]

	 SMLABT    r10, r6, r3, r10                   @x[7] * h[7]
	 SMLABT    r11, r9, r3, r11                   @x[8] * h[7]

	 LDR       r3, [r2], #4                       @h[8], h[9]
	 LDRSH     r4, [r1], #2                       @x[9]
	 LDRSH     r6, [r1], #2                       @x[10]

	 SMLABB    r10, r9, r3, r10                   @x[8] * h[8]
	 SMLABB    r11, r4, r3, r11                   @x[9] * h[8]

	 SMLABT    r10, r4, r3, r10                   @x[9] * h[9]
	 SMLABT    r11, r6, r3, r11                   @x[10] * h[9]

	 LDR       r3, [r2], #4                       @h[10], h[11]
	 LDRSH     r9, [r1], #2                       @x[11]
	 LDRSH     r4, [r1], #2                       @x[12]

	 SMLABB    r10, r6, r3, r10                   @x[10] * h[10]
	 SMLABB    r11, r9, r3, r11                   @x[11] * h[10]

	 SMLABT    r10, r9, r3, r10                   @x[11] * h[11]
	 SMLABT    r11, r4, r3, r11                   @x[12] * h[11]

	 LDR       r3, [r2], #4                       @h[12], h[13]
	 LDRSH     r6, [r1], #2                       @x[13]
	 LDRSH     r9, [r1], #2                       @x[14]

	 SMLABB    r10, r4, r3, r10                   @x[12] * h[12]
	 SMLABB    r11, r6, r3, r11                   @x[13] * h[12]

	 SMLABT    r10, r6, r3, r10                   @x[13] * h[13]
	 SMLABT    r11, r9, r3, r11                   @x[14] * h[13]

	 LDR       r3, [r2], #4                       @h[14], h[15]
	 LDRSH     r4, [r1], #2                       @x[15]
	 LDRSH     r6, [r1], #2                       @x[16]

	 SMLABB    r10, r9, r3, r10                   @x[14] * h[14]
	 SMLABB    r11, r4, r3, r11                   @x[15] * h[14]

	 SMLABT    r10, r4, r3, r10                   @x[15] * h[15]
	 SMLABT    r11, r6, r3, r11                   @x[16] * h[15]

	 LDR       r3, [r2], #4                       @h[16], h[17]
	 LDRSH     r9, [r1], #2                       @x[17]
	 LDRSH     r4, [r1], #2                       @x[18]

	 SMLABB    r10, r6, r3, r10                   @x[16] * h[16]
	 SMLABB    r11, r9, r3, r11                   @x[17] * h[16]

	 SMLABT    r10, r9, r3, r10                   @x[17] * h[17]
	 SMLABT    r11, r4, r3, r11                   @x[18] * h[17]

	 LDR       r3, [r2], #4                       @h[18], h[19]
	 LDRSH     r6, [r1], #2                       @x[19]
	 LDRSH     r9, [r1], #2                       @x[20]

	 SMLABB    r10, r4, r3, r10                   @x[18] * h[18]
	 SMLABB    r11, r6, r3, r11                   @x[19] * h[18]

	 SMLABT    r10, r6, r3, r10                   @x[19] * h[19]
	 SMLABT    r11, r9, r3, r11                   @x[20] * h[19]

	 LDR       r3, [r2], #4                       @h[20], h[21]
	 LDRSH     r4, [r1], #2                       @x[21]
	 LDRSH     r6, [r1], #2                       @x[22]

	 SMLABB    r10, r9, r3, r10                   @x[20] * h[20]
	 SMLABB    r11, r4, r3, r11                   @x[21] * h[20]

	 SMLABT    r10, r4, r3, r10                   @x[21] * h[21]
	 SMLABT    r11, r6, r3, r11                   @x[22] * h[21]

	 LDR       r3, [r2], #4                       @h[22], h[23]
	 LDRSH     r9, [r1], #2                       @x[23]
	 LDRSH     r4, [r1], #2                       @x[24]

	 SMLABB    r10, r6, r3, r10                   @x[22] * h[22]
	 SMLABB    r11, r9, r3, r11                   @x[23] * h[22]

	 SMLABT    r10, r9, r3, r10                   @x[23] * h[23]
	 SMLABT    r11, r4, r3, r11                   @x[24] * h[23]

	 LDR       r3, [r2], #4                       @h[24], h[25]
	 LDRSH     r6, [r1], #2                       @x[25]
	 LDRSH     r9, [r1], #2                       @x[26]

	 SMLABB    r10, r4, r3, r10                   @x[24] * h[24]
	 SMLABB    r11, r6, r3, r11                   @x[25] * h[24]

	 SMLABT    r10, r6, r3, r10                   @x[25] * h[25]
	 SMLABT    r11, r9, r3, r11                   @x[26] * h[25]

	 LDR       r3, [r2], #4                       @h[26], h[27]
	 LDRSH     r4, [r1], #2                       @x[27]
	 LDRSH     r6, [r1], #2                       @x[28]

	 SMLABB    r10, r9, r3, r10                   @x[26] * h[26]
	 SMLABB    r11, r4, r3, r11                   @x[27] * h[26]

	 SMLABT    r10, r4, r3, r10                   @x[27] * h[27]
	 SMLABT    r11, r6, r3, r11                   @x[28] * h[27]

	 LDR       r3, [r2], #4                       @h[28], h[29]
	 LDRSH     r9, [r1], #2                       @x[29]
	 LDRSH     r4, [r1], #2                       @x[30]

	 SMLABB    r10, r6, r3, r10                   @x[28] * h[28]
	 SMLABB    r11, r9, r3, r11                   @x[29] * h[28]

	 SMLABT    r10, r9, r3, r10                   @x[29] * h[29]
	 SMLABT    r11, r4, r3, r11                   @x[30] * h[29]

	 LDR       r3, [r2], #4                       @h[30], h[31]
	 LDRSH     r6, [r1], #2                       @x[31]
	 LDRSH     r9, [r1], #2                       @x[32]

	 SMLABB    r10, r4, r3, r10                   @x[30] * h[30]
	 SMLABB    r11, r6, r3, r11                   @x[31] * h[30]

	 SMLABT    r10, r6, r3, r10                   @x[31] * h[31]
	 SMLABT    r11, r9, r3, r11                   @x[32] * h[31]

	 @SSAT      r10, #32, r10, LSL #2
	 @SSAT      r11, #32, r11, LSL #2
	 MOV       r10, r10, LSL #1
	 MOV       r11, r11, LSL #1

	 QADD      r10, r10, r10
441
	 QADD      r11, r11, r11
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456

	 QADD      r10, r10, r5
	 QADD      r11, r11, r5

	 MOV       r10, r10, ASR #16
	 MOV       r11, r11, ASR #16

	 STRH      r10, [r0], #2
	 STRH      r11, [r0], #2


pred_lt4_end:
         LDMFD     r13!, {r4 - r12, r15}

Table:
457
         .word       voAWB_inter4_2-Table
458 459 460 461 462 463
	 @ENDFUNC
	 .END