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 DongarmVCM4P10_Interpolate_Chroma:
420c1bc742181ded4930842b46e9507372f0b1b963James Dong    PUSH     {r4-r12,lr}
430c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPUSH    {d8-d15}
440c1bc742181ded4930842b46e9507372f0b1b963James Dong    LDRD     r6,r7,[sp,#0x70]
450c1bc742181ded4930842b46e9507372f0b1b963James Dong    LDRD     r4,r5,[sp,#0x68]
460c1bc742181ded4930842b46e9507372f0b1b963James Dong    RSB      r8,r6,#8
470c1bc742181ded4930842b46e9507372f0b1b963James Dong    RSB      r9,r7,#8
480c1bc742181ded4930842b46e9507372f0b1b963James Dong    CMN      r6,r7
490c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r10,#1
5022e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    ADREQ    r11, armVCM4P10_WidthBranchTableMVIsZero
510c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUB      lr,r1,r10
5222e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    ADRNE    r11, armVCM4P10_WidthBranchTableMVIsNotZero
530c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
540c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r12,r8,r9
550c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r9,r6,r9
560c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
570c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r8,r8,r7
580c1bc742181ded4930842b46e9507372f0b1b963James Dong    SMULBB   r6,r6,r7
590c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d12,r12
600c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d13,r9
610c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d14,r8
620c1bc742181ded4930842b46e9507372f0b1b963James Dong    VDUP.8   d15,r6
6322e06318d04074d1a7c90caa173857abdcfd153eArd Biesheuvel    LDR      r11,[r11, r4, lsl #1]
6422e06318d04074d1a7c90caa173857abdcfd153eArd BiesheuvelP0: ADD      pc,r11
650c1bc742181ded4930842b46e9507372f0b1b963James Dong
660c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8MVIsNotZero:
670c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
680c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
690c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
700c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
710c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d16},[r0],r10
720c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
730c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d17},[r0],lr
740c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q11,d16,d12
750c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
760c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d18},[r0],r10
770c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
780c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d17,d13
790c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q12,d18,d12
800c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d19},[r0],lr
810c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d16,d14
820c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
830c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d19,d13
840c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d18,d14
850c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
860c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
870c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d0,d14
880c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d17,d15
890c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q11,d19,d15
900c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#4
910c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q12,d1,d15
920c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
930c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
940c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d20,q11,#6
950c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d8},[r2],r3
960c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d21,q12,#6
970c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d9},[r2],r3
980c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d20},[r2],r3
990c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d21},[r2],r3
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs8MVIsNotZero
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1040c1bc742181ded4930842b46e9507372f0b1b963James Dong
1050c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs4MVIsNotZero:
1060c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
1070c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
1080c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
1090c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
1100c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
1110c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
1120c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
1130c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
1140c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d0,d14
1150c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
1160c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d1,d15
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
1190c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
1200c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d8[0]},[r2],r3
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d9[0]},[r2],r3
1230c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs4MVIsNotZero
1240c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1250c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1260c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1270c1bc742181ded4930842b46e9507372f0b1b963James Dong
1280c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs2MVIsNotZero:
1290c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d2},[r0],r10
1300c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q2,d0,d12
1310c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMULL.U8 q3,d2,d12
1320c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d3},[r0],lr
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d1,d13
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d3,d13
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r10
1360c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d2,d14
1370c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d0,d14
1380c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],lr
1390c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1400c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q3,d1,d15
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong    VMLAL.U8 q2,d3,d15
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d9,q3,#6
1430c1bc742181ded4930842b46e9507372f0b1b963James Dong    VQRSHRN.U16 d8,q2,#6
1440c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d8[0]},[r2],r3
1450c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d9[0]},[r2],r3
1460c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs2MVIsNotZero
1470c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong
1510c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8MVIsZero:
1520c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUB      r0,r0,r1
1530c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs8LoopMVIsZero:
1540c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d0},[r2],r3
1580c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.64  {d1},[r2],r3
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs8LoopMVIsZero
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong
1640c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs4MVIsZero:
1650c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d0[0]},[r2],r3
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1690c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.32  {d1[0]},[r2],r3
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs4MVIsZero
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong
1750c1bc742181ded4930842b46e9507372f0b1b963James DongWidthIs2MVIsZero:
1760c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d1},[r0],r1
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong    SUBS     r5,r5,#2
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d0[0]},[r2],r3
1790c1bc742181ded4930842b46e9507372f0b1b963James Dong    VLD1.8   {d0},[r0],r1
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong    VST1.16  {d1[0]},[r2],r3
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong    BGT      WidthIs2MVIsZero
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong    MOV      r0,#0
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong    VPOP     {d8-d15}
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong    POP      {r4-r12,pc}
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong    .end
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong
188