10c1bc742181ded4930842b46e9507372f0b1b963James Dong@ 20c1bc742181ded4930842b46e9507372f0b1b963James Dong@ Copyright (C) 2009 The Android Open Source Project 30c1bc742181ded4930842b46e9507372f0b1b963James Dong@ 40c1bc742181ded4930842b46e9507372f0b1b963James Dong@ Licensed under the Apache License, Version 2.0 (the "License"); 50c1bc742181ded4930842b46e9507372f0b1b963James Dong@ you may not use this file except in compliance with the License. 60c1bc742181ded4930842b46e9507372f0b1b963James Dong@ You may obtain a copy of the License at 70c1bc742181ded4930842b46e9507372f0b1b963James Dong@ 80c1bc742181ded4930842b46e9507372f0b1b963James Dong@ http://www.apache.org/licenses/LICENSE-2.0 90c1bc742181ded4930842b46e9507372f0b1b963James Dong@ 100c1bc742181ded4930842b46e9507372f0b1b963James Dong@ Unless required by applicable law or agreed to in writing, software 110c1bc742181ded4930842b46e9507372f0b1b963James Dong@ distributed under the License is distributed on an "AS IS" BASIS, 120c1bc742181ded4930842b46e9507372f0b1b963James Dong@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130c1bc742181ded4930842b46e9507372f0b1b963James Dong@ See the License for the specific language governing permissions and 140c1bc742181ded4930842b46e9507372f0b1b963James Dong@ limitations under the License. 150c1bc742181ded4930842b46e9507372f0b1b963James Dong@ 160c1bc742181ded4930842b46e9507372f0b1b963James Dong 170c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "asm_common.S" 180c1bc742181ded4930842b46e9507372f0b1b963James Dong 197ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh PRESERVE8 200c1bc742181ded4930842b46e9507372f0b1b963James Dong 210c1bc742181ded4930842b46e9507372f0b1b963James Dong .fpu neon 220c1bc742181ded4930842b46e9507372f0b1b963James Dong .text 230c1bc742181ded4930842b46e9507372f0b1b963James Dong 240c1bc742181ded4930842b46e9507372f0b1b963James Dong/* Input / output registers */ 250c1bc742181ded4930842b46e9507372f0b1b963James Dong 260c1bc742181ded4930842b46e9507372f0b1b963James Dong#define ref r0 270c1bc742181ded4930842b46e9507372f0b1b963James Dong#define fill r1 280c1bc742181ded4930842b46e9507372f0b1b963James Dong#define left r2 290c1bc742181ded4930842b46e9507372f0b1b963James Dong#define tmp2 r2 300c1bc742181ded4930842b46e9507372f0b1b963James Dong#define center r3 310c1bc742181ded4930842b46e9507372f0b1b963James Dong#define right r4 320c1bc742181ded4930842b46e9507372f0b1b963James Dong#define tmp1 r5 330c1bc742181ded4930842b46e9507372f0b1b963James Dong 340c1bc742181ded4930842b46e9507372f0b1b963James Dong/* -- NEON registers -- */ 350c1bc742181ded4930842b46e9507372f0b1b963James Dong 367ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define qTmp0 Q0 377ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define qTmp1 Q1 387ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define dTmp0 D0 397ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define dTmp1 D1 407ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define dTmp2 D2 417ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh#define dTmp3 D3 420c1bc742181ded4930842b46e9507372f0b1b963James Dong 430c1bc742181ded4930842b46e9507372f0b1b963James Dong/* 440c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdFillRow7(const u8 * ref, u8 * fill, i32 left, i32 center, 450c1bc742181ded4930842b46e9507372f0b1b963James Dong i32 right); 460c1bc742181ded4930842b46e9507372f0b1b963James Dong*/ 470c1bc742181ded4930842b46e9507372f0b1b963James Dong 480c1bc742181ded4930842b46e9507372f0b1b963James Dongfunction h264bsdFillRow7, export=1 490c1bc742181ded4930842b46e9507372f0b1b963James Dong 500c1bc742181ded4930842b46e9507372f0b1b963James Dong PUSH {r4-r6,lr} 510c1bc742181ded4930842b46e9507372f0b1b963James Dong CMP left, #0 520c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR right, [sp,#0x10] 530c1bc742181ded4930842b46e9507372f0b1b963James Dong BEQ switch_center 540c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRB tmp1, [ref,#0] 550c1bc742181ded4930842b46e9507372f0b1b963James Dong 560c1bc742181ded4930842b46e9507372f0b1b963James Dongloop_left: 570c1bc742181ded4930842b46e9507372f0b1b963James Dong SUBS left, left, #1 580c1bc742181ded4930842b46e9507372f0b1b963James Dong STRB tmp1, [fill], #1 590c1bc742181ded4930842b46e9507372f0b1b963James Dong BNE loop_left 600c1bc742181ded4930842b46e9507372f0b1b963James Dong 610c1bc742181ded4930842b46e9507372f0b1b963James Dongswitch_center: 620c1bc742181ded4930842b46e9507372f0b1b963James Dong ASR tmp2,center,#2 630c1bc742181ded4930842b46e9507372f0b1b963James Dong CMP tmp2,#9 640c1bc742181ded4930842b46e9507372f0b1b963James Dong ADDCC pc,pc,tmp2,LSL #2 650c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 660c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 670c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_1 680c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_2 690c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_3 700c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_4 710c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_5 720c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_6 730c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_7 740c1bc742181ded4930842b46e9507372f0b1b963James Dong B case_8 750c1bc742181ded4930842b46e9507372f0b1b963James Dong 760c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_8: 777ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {qTmp0, qTmp1}, [ref]! 780c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #32 797ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {qTmp0}, [fill]! 807ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {qTmp1}, [fill]! 810c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 820c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_7: 837ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {dTmp0,dTmp1,dTmp2}, [ref]! 840c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #28 850c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR tmp2, [ref], #4 867ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {dTmp0,dTmp1,dTmp2}, [fill]! 870c1bc742181ded4930842b46e9507372f0b1b963James Dong STR tmp2, [fill],#4 880c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 890c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_6: 907ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {dTmp0,dTmp1,dTmp2}, [ref]! 910c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #24 927ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {dTmp0,dTmp1,dTmp2}, [fill]! 930c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 940c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_5: 957ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {qTmp0}, [ref]! 960c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #20 970c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR tmp2, [ref], #4 987ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {qTmp0}, [fill]! 990c1bc742181ded4930842b46e9507372f0b1b963James Dong STR tmp2, [fill],#4 1000c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 1010c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_4: 1027ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {qTmp0}, [ref]! 1030c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #16 1047ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 {qTmp0}, [fill]! 1050c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 1060c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_3: 1077ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VLD1.8 {dTmp0}, [ref]! 1080c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #12 1090c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR tmp2, [ref], #4 1107ea582e1dbdd9a88b2105fbe29ed0ec92cbf70c6Chih-Hung Hsieh VST1.8 dTmp0, [fill]! 1110c1bc742181ded4930842b46e9507372f0b1b963James Dong STR tmp2, [fill],#4 1120c1bc742181ded4930842b46e9507372f0b1b963James Dong B loop_center 1130c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_2: 1140c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR tmp2, [ref],#4 1150c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #4 1160c1bc742181ded4930842b46e9507372f0b1b963James Dong STR tmp2, [fill], #4 1170c1bc742181ded4930842b46e9507372f0b1b963James Dongcase_1: 1180c1bc742181ded4930842b46e9507372f0b1b963James Dong LDR tmp2, [ref],#4 1190c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #4 1200c1bc742181ded4930842b46e9507372f0b1b963James Dong STR tmp2, [fill], #4 1210c1bc742181ded4930842b46e9507372f0b1b963James Dong 1220c1bc742181ded4930842b46e9507372f0b1b963James Dongloop_center: 1230c1bc742181ded4930842b46e9507372f0b1b963James Dong CMP center, #0 1240c1bc742181ded4930842b46e9507372f0b1b963James Dong BEQ jump 1250c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRB tmp2, [ref], #1 1260c1bc742181ded4930842b46e9507372f0b1b963James Dong SUB center, center, #1 1270c1bc742181ded4930842b46e9507372f0b1b963James Dong STRB tmp2, [fill], #1 1280c1bc742181ded4930842b46e9507372f0b1b963James Dong BNE loop_center 1290c1bc742181ded4930842b46e9507372f0b1b963James Dongjump: 1300c1bc742181ded4930842b46e9507372f0b1b963James Dong CMP right,#0 1310c1bc742181ded4930842b46e9507372f0b1b963James Dong POPEQ {r4-r6,pc} 1320c1bc742181ded4930842b46e9507372f0b1b963James Dong LDRB tmp2, [ref,#-1] 1330c1bc742181ded4930842b46e9507372f0b1b963James Dong 1340c1bc742181ded4930842b46e9507372f0b1b963James Dongloop_right: 1350c1bc742181ded4930842b46e9507372f0b1b963James Dong STRB tmp2, [fill], #1 1360c1bc742181ded4930842b46e9507372f0b1b963James Dong SUBS right, right, #1 1370c1bc742181ded4930842b46e9507372f0b1b963James Dong BNE loop_right 1380c1bc742181ded4930842b46e9507372f0b1b963James Dong 1390c1bc742181ded4930842b46e9507372f0b1b963James Dong POP {r4-r6,pc} 1400c1bc742181ded4930842b46e9507372f0b1b963James Dong 1410c1bc742181ded4930842b46e9507372f0b1b963James Dongendfunction 1420c1bc742181ded4930842b46e9507372f0b1b963James Dong 1430c1bc742181ded4930842b46e9507372f0b1b963James Dong 144