michael@0: /*************************************************************************** michael@0: * Copyright (c) 2009,2010, Code Aurora Forum. All rights reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: ***************************************************************************/ michael@0: michael@0: .code 32 michael@0: .fpu neon michael@0: .align 4 michael@0: .globl memset32_neon michael@0: .func michael@0: michael@0: /* r0 = buffer, r1 = value, r2 = times to write */ michael@0: memset32_neon: michael@0: cmp r2, #1 michael@0: streq r1, [r0], #4 michael@0: bxeq lr michael@0: michael@0: cmp r2, #4 michael@0: bgt memset32_neon_start michael@0: cmp r2, #0 michael@0: bxeq lr michael@0: memset32_neon_small: michael@0: str r1, [r0], #4 michael@0: subs r2, r2, #1 michael@0: bne memset32_neon_small michael@0: bx lr michael@0: memset32_neon_start: michael@0: cmp r2, #16 michael@0: blt memset32_dropthru michael@0: vdup.32 q0, r1 michael@0: vmov q1, q0 michael@0: cmp r2, #32 michael@0: blt memset32_16 michael@0: cmp r2, #64 michael@0: blt memset32_32 michael@0: cmp r2, #128 michael@0: blt memset32_64 michael@0: memset32_128: michael@0: movs r12, r2, lsr #7 michael@0: memset32_loop128: michael@0: subs r12, r12, #1 michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: bne memset32_loop128 michael@0: ands r2, r2, #0x7f michael@0: bxeq lr michael@0: memset32_64: michael@0: movs r12, r2, lsr #6 michael@0: beq memset32_32 michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: ands r2, r2, #0x3f michael@0: bxeq lr michael@0: memset32_32: michael@0: movs r12, r2, lsr #5 michael@0: beq memset32_16 michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: ands r2, r2, #0x1f michael@0: bxeq lr michael@0: memset32_16: michael@0: movs r12, r2, lsr #4 michael@0: beq memset32_dropthru michael@0: and r2, r2, #0xf michael@0: vst1.64 {q0, q1}, [r0]! michael@0: vst1.64 {q0, q1}, [r0]! michael@0: memset32_dropthru: michael@0: rsb r2, r2, #15 michael@0: add pc, pc, r2, lsl #2 michael@0: nop michael@0: str r1, [r0, #56] michael@0: str r1, [r0, #52] michael@0: str r1, [r0, #48] michael@0: str r1, [r0, #44] michael@0: str r1, [r0, #40] michael@0: str r1, [r0, #36] michael@0: str r1, [r0, #32] michael@0: str r1, [r0, #28] michael@0: str r1, [r0, #24] michael@0: str r1, [r0, #20] michael@0: str r1, [r0, #16] michael@0: str r1, [r0, #12] michael@0: str r1, [r0, #8] michael@0: str r1, [r0, #4] michael@0: str r1, [r0, #0] michael@0: bx lr michael@0: michael@0: .endfunc michael@0: .end