Home | History | Annotate | Download | only in armv7
      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_conv_ergtoamplitudelp_armv7
     25 ixheaacd_conv_ergtoamplitudelp_armv7:
     26 
     27     STMFD           sp!, {r4-r12, r14}
     28 
     29     LDR             R5, [SP, #44]
     30     LDR             R4, [SP, #40]
     31     LDR             R11, =0x5A82
     32     LDR             R10, =0x1FF
     33 
     34 LOOP1:
     35 
     36     LDRSH           R6, [R2, #0]
     37     MOV             R12, #0
     38     MOV             R14, #-16
     39     MOVS            R6, R6
     40     BLE             ENDIF1_1
     41 
     42     LDRSH           R7, [R2, #2]
     43     CLZ             R8, R6
     44     SUB             R8, R8, #17
     45     SUB             R7, R7, R8
     46     MOV             R6, R6, LSL R8
     47     MOV             R6, R6, ASR #5
     48     AND             R6, R6, R10
     49 
     50     TST             R7, #1
     51     BIC             R6, R6, #1
     52     LDRH            R12, [R6, R5]
     53     ADDNE           R7, R7, #3
     54     MOV             R14, R7, ASR #1
     55     SMULWBNE        R12, R12, R11
     56 
     57 ENDIF1_1:
     58     STRH            R14, [R2, #2]
     59 
     60 
     61     LDRSH           R6, [R3, #0]
     62     MOV             R8, #0
     63     MOV             R9, #-16
     64 
     65     MOVS            R6, R6
     66     BLE             ENDIF1_2
     67 
     68     LDRSH           R7, [R3, #2]
     69     CLZ             R8, R6
     70     SUB             R8, R8, #17
     71     SUB             R7, R7, R8
     72     MOV             R6, R6, LSL R8
     73     MOV             R6, R6, ASR #5
     74     AND             R6, R6, R10
     75 
     76     TST             R7, #1
     77     BIC             R6, R6, #1
     78     LDRH            R8, [R6, R5]
     79     ADDNE           R7, R7, #3
     80     MOV             R9, R7, ASR #1
     81     SMULWBNE        R8, R8, R11
     82 
     83 ENDIF1_2:
     84     STRH            R9, [R3, #2]
     85     STRH            R8, [R3], #4
     86 
     87 
     88 
     89 
     90     LDRSH           R6, [R4, #0]
     91     MOV             R8, #0
     92     MOV             R9, #-16
     93     MOVS            R6, R6
     94     BLE             ENDIF1_3
     95 
     96     LDRSH           R7, [R4, #2]
     97     CLZ             R8, R6
     98     SUB             R8, R8, #17
     99     SUB             R7, R7, R8
    100     MOV             R6, R6, LSL R8
    101     MOV             R6, R6, ASR #5
    102     ANDS            R6, R6, R10
    103 
    104     TST             R7, #1
    105     BIC             R6, R6, #1
    106     LDRH            R8, [R6, R5]
    107     ADDNE           R7, R7, #3
    108     MOV             R9, R7, ASR #1
    109     SMULWBNE        R8, R8, R11
    110 
    111 ENDIF1_3:
    112     STRH            R9, [R4, #2]
    113 
    114     SUB             R6, R1, R9
    115     SUBS            R6, R6, #4
    116 
    117     RSBLE           R6, R6, #0
    118     MOVGT           R8, R8, ASR R6
    119     MOVLE           R8, R8, LSL R6
    120     STRH            R8, [R4], #4
    121 
    122 
    123     SUBS            R6, R14, R1
    124     BLE             ELSE1
    125 
    126     CMP             R6, #15
    127     MOVGT           R6, #15
    128     MOV             R12, R12, LSL R6
    129     CMP             R12, #0x8000
    130     MVNGE           R12, #0x8000
    131     CMNLT           R12, #0x00008000
    132     MOVLT           R12, #0x00008000
    133     STRH            R12, [R2], #4
    134     SUBS            R0, R0, #1
    135     BGT             LOOP1
    136 
    137 ELSE1:
    138     RSB             R6, R6, #0
    139     MOV             R12, R12, ASR R6
    140     STRH            R12, [R2], #4
    141     SUBS            R0, R0, #1
    142     BGT             LOOP1
    143     LDMFD           sp!, {r4-r12, r15}
    144 
    145 
    146 
    147 
    148 
    149