1; 2; Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3; 4; Use of this source code is governed by a BSD-style license 5; that can be found in the LICENSE file in the root of the source 6; tree. An additional intellectual property rights grant can be found 7; in the file PATENTS. All contributing project authors may 8; be found in the AUTHORS file in the root of the source tree. 9; 10 11 12 EXPORT |vp8_copy_mem8x4_v6| 13 ; ARM 14 ; REQUIRE8 15 ; PRESERVE8 16 17 AREA Block, CODE, READONLY ; name this block of code 18;void vp8_copy_mem8x4_v6( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride) 19;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 20|vp8_copy_mem8x4_v6| PROC 21 ;push {r4-r5} 22 stmdb sp!, {r4-r5} 23 24 ;preload 25 pld [r0] 26 pld [r0, r1] 27 pld [r0, r1, lsl #1] 28 29 ands r4, r0, #7 30 beq copy_mem8x4_fast 31 32 ands r4, r0, #3 33 beq copy_mem8x4_4 34 35 ;copy 1 byte each time 36 ldrb r4, [r0] 37 ldrb r5, [r0, #1] 38 39 mov r12, #4 40 41copy_mem8x4_1_loop 42 strb r4, [r2] 43 strb r5, [r2, #1] 44 45 ldrb r4, [r0, #2] 46 ldrb r5, [r0, #3] 47 48 subs r12, r12, #1 49 50 strb r4, [r2, #2] 51 strb r5, [r2, #3] 52 53 ldrb r4, [r0, #4] 54 ldrb r5, [r0, #5] 55 56 strb r4, [r2, #4] 57 strb r5, [r2, #5] 58 59 ldrb r4, [r0, #6] 60 ldrb r5, [r0, #7] 61 62 add r0, r0, r1 63 64 strb r4, [r2, #6] 65 strb r5, [r2, #7] 66 67 add r2, r2, r3 68 69 ldrneb r4, [r0] 70 ldrneb r5, [r0, #1] 71 72 bne copy_mem8x4_1_loop 73 74 ldmia sp!, {r4 - r5} 75 ;pop {r4-r5} 76 mov pc, lr 77 78;copy 4 bytes each time 79copy_mem8x4_4 80 ldr r4, [r0] 81 ldr r5, [r0, #4] 82 83 mov r12, #4 84 85copy_mem8x4_4_loop 86 subs r12, r12, #1 87 add r0, r0, r1 88 89 str r4, [r2] 90 str r5, [r2, #4] 91 92 add r2, r2, r3 93 94 ldrne r4, [r0] 95 ldrne r5, [r0, #4] 96 97 bne copy_mem8x4_4_loop 98 99 ldmia sp!, {r4-r5} 100 ;pop {r4-r5} 101 mov pc, lr 102 103;copy 8 bytes each time 104copy_mem8x4_fast 105 ;sub r1, r1, #8 106 ;sub r3, r3, #8 107 108 mov r12, #4 109 110copy_mem8x4_fast_loop 111 ldmia r0, {r4-r5} 112 ;ldm r0, {r4-r5} 113 add r0, r0, r1 114 115 subs r12, r12, #1 116 stmia r2, {r4-r5} 117 ;stm r2, {r4-r5} 118 add r2, r2, r3 119 120 bne copy_mem8x4_fast_loop 121 122 ldmia sp!, {r4-r5} 123 ;pop {r4-r5} 124 mov pc, lr 125 126 ENDP ; |vp8_copy_mem8x4_v6| 127 128 END 129