armVCM4P10_Interpolate_Chroma_s.S revision 78e52bfac041d71ce53b5b13c2abf78af742b09d
10c1bc742181ded4930842b46e9507372f0b1b963James Dong/*
278e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * Copyright (C) 2007-2008 ARM Limited
378e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar *
478e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * Licensed under the Apache License, Version 2.0 (the "License");
578e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * you may not use this file except in compliance with the License.
678e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * You may obtain a copy of the License at
778e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar *
878e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar *      http://www.apache.org/licenses/LICENSE-2.0
978e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar *
1078e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * Unless required by applicable law or agreed to in writing, software
1178e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * distributed under the License is distributed on an "AS IS" BASIS,
1278e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1378e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * See the License for the specific language governing permissions and
1478e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar * limitations under the License.
1578e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar *
1678e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar */
1778e52bfac041d71ce53b5b13c2abf78af742b09dLajos Molnar/*
180c1bc742181ded4930842b46e9507372f0b1b963James Dong *
190c1bc742181ded4930842b46e9507372f0b1b963James Dong */
200c1bc742181ded4930842b46e9507372f0b1b963James Dong
210c1bc742181ded4930842b46e9507372f0b1b963James Dong    .eabi_attribute 24, 1
220c1bc742181ded4930842b46e9507372f0b1b963James Dong    .eabi_attribute 25, 1
230c1bc742181ded4930842b46e9507372f0b1b963James Dong
240c1bc742181ded4930842b46e9507372f0b1b963James Dong    .arm
250c1bc742181ded4930842b46e9507372f0b1b963James Dong    .fpu neon
260c1bc742181ded4930842b46e9507372f0b1b963James Dong
2722e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .text
280c1bc742181ded4930842b46e9507372f0b1b963James Dong    .align 4
290c1bc742181ded4930842b46e9507372f0b1b963James Dong
300c1bc742181ded4930842b46e9507372f0b1b963James DongarmVCM4P10_WidthBranchTableMVIsNotZero:
3122e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs2MVIsNotZero-(P0+8), WidthIs2MVIsNotZero-(P0+8)
3222e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs4MVIsNotZero-(P0+8), WidthIs4MVIsNotZero-(P0+8)
3322e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs8MVIsNotZero-(P0+8)
340c1bc742181ded4930842b46e9507372f0b1b963James Dong
350c1bc742181ded4930842b46e9507372f0b1b963James DongarmVCM4P10_WidthBranchTableMVIsZero:
3622e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs2MVIsZero-(P0+8), WidthIs2MVIsZero-(P0+8)
3722e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs4MVIsZero-(P0+8), WidthIs4MVIsZero-(P0+8)
3822e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    .word   WidthIs8MVIsZero-(P0+8)
390c1bc742181ded4930842b46e9507372f0b1b963James Dong
400c1bc742181ded4930842b46e9507372f0b1b963James Dong    .global armVCM4P10_Interpolate_Chroma
410c1bc742181ded4930842b46e9507372f0b1b963James Dong    .func   armVCM4P10_Interpolate_Chroma
420c1bc742181ded4930842b46e9507372f0b1b963James DongarmVCM4P10_Interpolate_Chroma:
430c1bc742181ded4930842b46e9507372f0b1b963James Dong    PUSH     {r4-r12,lr}
440c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPUSH    {d8-d15}
450c1bc742181ded4930842b46e9507372f0b1b963James Dong    LDRD     r6,r7,[sp,#0x70]
460c1bc742181ded4930842b46e9507372f0b1b963James Dong    LDRD     r4,r5,[sp,#0x68]
470c1bc742181ded4930842b46e9507372f0b1b963James Dong    RSB      r8,r6,#8
480c1bc742181ded4930842b46e9507372f0b1b963James Dong    RSB      r9,r7,#8
490c1bc742181ded4930842b46e9507372f0b1b963James Dong    CMN      r6,r7
500c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r10,#1
5122e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    ADREQ    r11, armVCM4P10_WidthBranchTableMVIsZero
520c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUB      lr,r1,r10
5322e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    ADRNE    r11, armVCM4P10_WidthBranchTableMVIsNotZero
540c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
550c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r12,r8,r9
560c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r9,r6,r9
570c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
580c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r8,r8,r7
590c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r6,r6,r7
600c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d12,r12
610c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d13,r9
620c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d14,r8
630c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d15,r6
6422e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    LDR      r11,[r11, r4, lsl #1]
6522e06318d04074d1a7c90caa173857abdcfd153eArd BiesheuvelP0: ADD      pc,r11
660c1bc742181ded4930842b46e9507372f0b1b963James Dong
670c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8MVIsNotZero:
680c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
690c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
700c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
710c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
720c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d16},[r0],r10
730c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
740c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d17},[r0],lr
750c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q11,d16,d12
760c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
770c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d18},[r0],r10
780c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
790c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d17,d13
800c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q12,d18,d12
810c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d19},[r0],lr
820c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d16,d14
830c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
840c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d19,d13
850c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d18,d14
860c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
870c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
880c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d0,d14
890c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d17,d15
900c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d19,d15
910c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#4
920c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d1,d15
930c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
940c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
950c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d20,q11,#6
960c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d8},[r2],r3
970c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d21,q12,#6
980c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d9},[r2],r3
990c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d20},[r2],r3
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d21},[r2],r3
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs8MVIsNotZero
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1040c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1050c1bc742181ded4930842b46e9507372f0b1b963James Dong
1060c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs4MVIsNotZero:
1070c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
1080c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
1090c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
1100c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
1110c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
1120c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
1130c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
1140c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
1150c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d0,d14
1160c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d1,d15
1190c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
1200c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d8[0]},[r2],r3
1230c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d9[0]},[r2],r3
1240c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs4MVIsNotZero
1250c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1260c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1270c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1280c1bc742181ded4930842b46e9507372f0b1b963James Dong
1290c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs2MVIsNotZero:
1300c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
1310c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
1320c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
1360c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
1370c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
1380c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d0,d14
1390c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
1400c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d1,d15
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
1430c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
1440c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
1450c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d8[0]},[r2],r3
1460c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d9[0]},[r2],r3
1470c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs2MVIsNotZero
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1510c1bc742181ded4930842b46e9507372f0b1b963James Dong
1520c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8MVIsZero:
1530c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUB      r0,r0,r1
1540c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8LoopMVIsZero:
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1580c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d0},[r2],r3
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d1},[r2],r3
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs8LoopMVIsZero
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1640c1bc742181ded4930842b46e9507372f0b1b963James Dong
1650c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs4MVIsZero:
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d0[0]},[r2],r3
1690c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d1[0]},[r2],r3
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs4MVIsZero
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1750c1bc742181ded4930842b46e9507372f0b1b963James Dong
1760c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs2MVIsZero:
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1790c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d0[0]},[r2],r3
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d1[0]},[r2],r3
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs2MVIsZero
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong    .endfunc
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong
1880c1bc742181ded4930842b46e9507372f0b1b963James Dong    .end
1890c1bc742181ded4930842b46e9507372f0b1b963James Dong
190