Home | History | Annotate | Download | only in armv8
      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 .global ixheaacd_calc_max_spectral_line_armv8
     24 ixheaacd_calc_max_spectral_line_armv8:
     25 
     26     LSR             W4, W1, #3
     27     LSL             W6, W4, #3
     28     MOV             w11, #0x00000000
     29     MOV             V3.S[0], w11
     30     MOV             V3.S[1], w11
     31     MOV             V3.S[2], w11
     32     MOV             V3.S[3], w11
     33 
     34 LOOP_1:
     35     LD1             {V0.4S}, [X0], #16
     36     LD1             {V1.4S}, [X0], #16
     37 
     38     ABS             V0.4S, V0.4S
     39     ABS             V1.4S, V1.4S
     40 
     41     SUBS            W4, W4, #1
     42 
     43     ORR             V3.16B, V0.16B, V3.16B
     44     ORR             V3.16B, V1.16B, V3.16B
     45 
     46     BGT             LOOP_1
     47 
     48     SUBS            W7, W1, W6
     49 
     50     MOV             W4, V3.S[0]
     51     MOV             W1, V3.S[1]
     52     MOV             W2, V3.S[2]
     53     ORR             W4, W4, W1
     54     MOV             W3, V3.S[3]
     55     ORR             W4, W4, W2
     56     ORR             W4, W4, W3
     57     BEQ             END_FUNC
     58 LOOP_2:
     59 
     60     LDR             W2, [X0], #4
     61 
     62     CMP             W2, #0
     63 
     64     CNEG            W2, W2, LE
     65     ORR             W4, W4, W2
     66     SUBS            W7, W7, #1
     67     BGT             LOOP_2
     68 
     69 END_FUNC:
     70 
     71     MOV             W0, W4
     72     CMP             W0, #0
     73 
     74     CNEG            W0, W0, LE
     75     CLZ             W0, W0
     76     SUB             W0, W0, #1
     77 
     78     RET
     79 
     80 
     81 
     82 
     83