Home | History | Annotate | Download | only in ARMV5E
      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 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     18 @	File:		AutoCorrelation_v5.s
     19 @
     20 @	Content:	AutoCorrelation function armv5 assemble
     21 @
     22 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     23 
     24 
     25 	.section .text
     26 	.global	AutoCorrelation
     27 
     28 AutoCorrelation:
     29 	stmdb     sp!, {r4 - r11, lr}
     30 
     31   sub     r13, r13, #20
     32 
     33   mov     r5, r0
     34   mov     r7, r1
     35   mov     r9, r3
     36   mov     r2, r2, lsl #16
     37   mov     r0, #0
     38   mov     r4, r2, asr #16
     39   mov     r8, #0
     40   cmp     r4, #0
     41   ble     L136
     42 
     43 	cmp     r4, #8
     44 	mov		  r2, #0
     45   blt     L133
     46 
     47 	sub     r12, r4, #8
     48 L132:
     49   ldr     r6, [r5, r2]
     50 	add		  r2, r2, #4
     51 	smulbb  r3, r6, r6
     52 	ldr     r1, [r5, r2]
     53 	smultt	r10, r6, r6
     54 	mov		  r3, r3, asr #9
     55 	smulbb	r6, r1, r1
     56 	mov		  r10, r10, asr #9
     57 	qadd	  r0, r0, r3
     58 	smultt	r11, r1, r1
     59 	add     r2, r2, #4
     60 	qadd	  r0, r0, r10
     61 	mov		  r6, r6, asr #9
     62 	mov		  r11, r11, asr #9
     63 	ldr		  r1, [r5, r2]
     64 	qadd	  r0, r0, r6
     65 	smulbb	r10, r1, r1
     66 	smultt	r6, r1, r1
     67 	qadd	  r0, r0, r11
     68 	mov		  r10, r10, asr #9
     69 	mov		  r6, r6, asr #9
     70 	qadd	  r0, r0, r10
     71 	add     r2, r2, #4
     72 	add     r8, r8, #6
     73 
     74 	qadd	  r0, r0, r6
     75 	cmp     r8, r12
     76   blt     L132
     77 L133:
     78   ldrsh   r6, [r5, r2]
     79   mul     r10, r6, r6
     80 	add     r2, r2, #2
     81   mov     r1, r10, asr #9
     82   qadd    r0, r0, r1
     83 L134:
     84   add     r8, r8, #1
     85   cmp     r8, r4
     86   blt     L133
     87 L135:
     88 L136:
     89   str     r0, [r7, #0]
     90   cmp     r0, #0
     91   beq     L1320
     92 L137:
     93   mov     r2, r9, lsl #16
     94 	mov     r8, #1
     95   mov     r2, r2, asr #16
     96   cmp     r2, #1
     97   ble     L1319
     98 L138:
     99 L139:
    100   sub     r4, r4, #1
    101   mov     r14, #0
    102   mov     r3, #0
    103   cmp     r4, #0
    104   ble     L1317
    105 L1310:
    106   cmp     r4, #6
    107   addlt   r6, r5, r8, lsl #1
    108   blt     L1314
    109 L1311:
    110   add     r6, r5, r8, lsl #1
    111   sub     r12, r4, #6
    112   str     r8, [r13, #8]
    113   str     r7, [r13, #4]
    114 L1312:
    115   mov     r1, r3, lsl #1
    116   ldrsh   r7, [r6, r1]
    117   ldrsh   r10, [r5, r1]
    118   add     r8, r1, r6
    119 	add     r9, r5, r1
    120 	mul     r7, r10, r7
    121   ldrsh   r1, [r8, #2]
    122 	ldrsh   r10, [r8, #4]
    123   add     r7, r14, r7, asr #9
    124   ldrsh   r0, [r9, #2]
    125   ldrsh   r11, [r9, #4]
    126   mul     r1, r0, r1
    127   ldrsh   r14, [r8, #6]
    128   mul     r10, r11, r10
    129 	add     r7, r7, r1, asr #9
    130   ldrsh   r8, [r8, #8]
    131 	add     r3, r3, #5
    132 	ldrsh   r11, [r9, #6]
    133   ldrsh   r1, [r9, #8]
    134   mul     r14, r11, r14
    135   add     r7, r7, r10, asr #9
    136   mul     r1, r1, r8
    137   add     r14, r7, r14, asr #9
    138 	cmp     r3, r12
    139   add     r14, r14, r1, asr #9
    140   ble     L1312
    141 L1313:
    142   ldr     r8, [r13, #8]
    143   ldr     r7, [r13, #4]
    144 L1314:
    145 L1315:
    146   mov     r12, r3, lsl #1
    147   ldrsh   r9, [r6, r12]
    148   ldrsh   r12, [r5, r12]
    149   add     r3, r3, #1
    150   cmp     r3, r4
    151   mul     r12, r12, r9
    152   add     r14, r14, r12, asr #9
    153   blt     L1315
    154 L1316:
    155 L1317:
    156   str     r14, [r7, +r8, lsl #2]
    157   add     r8, r8, #1
    158   cmp     r8, r2
    159   blt     L139
    160 
    161 L1319:
    162 L1320:
    163 	add     r13, r13, #20
    164 	ldmia   sp!, {r4 - r11, pc}
    165 
    166 	@ENDP  @ |AutoCorrelation|
    167 	.end
    168