1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/opts/memset32_neon.S Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,113 @@ 1.4 +/*************************************************************************** 1.5 + * Copyright (c) 2009,2010, Code Aurora Forum. All rights reserved. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + ***************************************************************************/ 1.10 + 1.11 + .code 32 1.12 + .fpu neon 1.13 + .align 4 1.14 + .globl memset32_neon 1.15 + .func 1.16 + 1.17 + /* r0 = buffer, r1 = value, r2 = times to write */ 1.18 +memset32_neon: 1.19 + cmp r2, #1 1.20 + streq r1, [r0], #4 1.21 + bxeq lr 1.22 + 1.23 + cmp r2, #4 1.24 + bgt memset32_neon_start 1.25 + cmp r2, #0 1.26 + bxeq lr 1.27 +memset32_neon_small: 1.28 + str r1, [r0], #4 1.29 + subs r2, r2, #1 1.30 + bne memset32_neon_small 1.31 + bx lr 1.32 +memset32_neon_start: 1.33 + cmp r2, #16 1.34 + blt memset32_dropthru 1.35 + vdup.32 q0, r1 1.36 + vmov q1, q0 1.37 + cmp r2, #32 1.38 + blt memset32_16 1.39 + cmp r2, #64 1.40 + blt memset32_32 1.41 + cmp r2, #128 1.42 + blt memset32_64 1.43 +memset32_128: 1.44 + movs r12, r2, lsr #7 1.45 +memset32_loop128: 1.46 + subs r12, r12, #1 1.47 + vst1.64 {q0, q1}, [r0]! 1.48 + vst1.64 {q0, q1}, [r0]! 1.49 + vst1.64 {q0, q1}, [r0]! 1.50 + vst1.64 {q0, q1}, [r0]! 1.51 + vst1.64 {q0, q1}, [r0]! 1.52 + vst1.64 {q0, q1}, [r0]! 1.53 + vst1.64 {q0, q1}, [r0]! 1.54 + vst1.64 {q0, q1}, [r0]! 1.55 + vst1.64 {q0, q1}, [r0]! 1.56 + vst1.64 {q0, q1}, [r0]! 1.57 + vst1.64 {q0, q1}, [r0]! 1.58 + vst1.64 {q0, q1}, [r0]! 1.59 + vst1.64 {q0, q1}, [r0]! 1.60 + vst1.64 {q0, q1}, [r0]! 1.61 + vst1.64 {q0, q1}, [r0]! 1.62 + vst1.64 {q0, q1}, [r0]! 1.63 + bne memset32_loop128 1.64 + ands r2, r2, #0x7f 1.65 + bxeq lr 1.66 +memset32_64: 1.67 + movs r12, r2, lsr #6 1.68 + beq memset32_32 1.69 + vst1.64 {q0, q1}, [r0]! 1.70 + vst1.64 {q0, q1}, [r0]! 1.71 + vst1.64 {q0, q1}, [r0]! 1.72 + vst1.64 {q0, q1}, [r0]! 1.73 + vst1.64 {q0, q1}, [r0]! 1.74 + vst1.64 {q0, q1}, [r0]! 1.75 + vst1.64 {q0, q1}, [r0]! 1.76 + vst1.64 {q0, q1}, [r0]! 1.77 + ands r2, r2, #0x3f 1.78 + bxeq lr 1.79 +memset32_32: 1.80 + movs r12, r2, lsr #5 1.81 + beq memset32_16 1.82 + vst1.64 {q0, q1}, [r0]! 1.83 + vst1.64 {q0, q1}, [r0]! 1.84 + vst1.64 {q0, q1}, [r0]! 1.85 + vst1.64 {q0, q1}, [r0]! 1.86 + ands r2, r2, #0x1f 1.87 + bxeq lr 1.88 +memset32_16: 1.89 + movs r12, r2, lsr #4 1.90 + beq memset32_dropthru 1.91 + and r2, r2, #0xf 1.92 + vst1.64 {q0, q1}, [r0]! 1.93 + vst1.64 {q0, q1}, [r0]! 1.94 +memset32_dropthru: 1.95 + rsb r2, r2, #15 1.96 + add pc, pc, r2, lsl #2 1.97 + nop 1.98 + str r1, [r0, #56] 1.99 + str r1, [r0, #52] 1.100 + str r1, [r0, #48] 1.101 + str r1, [r0, #44] 1.102 + str r1, [r0, #40] 1.103 + str r1, [r0, #36] 1.104 + str r1, [r0, #32] 1.105 + str r1, [r0, #28] 1.106 + str r1, [r0, #24] 1.107 + str r1, [r0, #20] 1.108 + str r1, [r0, #16] 1.109 + str r1, [r0, #12] 1.110 + str r1, [r0, #8] 1.111 + str r1, [r0, #4] 1.112 + str r1, [r0, #0] 1.113 + bx lr 1.114 + 1.115 + .endfunc 1.116 + .end