1 /* SPDX-License-Identifier: MIT */
3 * memset - fill memory with a constant byte
5 * Copyright (c) 2012-2021, Arm Limited.
10 * ARMv8-a, AArch64, Advanced SIMD, unaligned accesses.
29 add dstend, dstin, count
37 /* Set 0..15 bytes. */
45 str valw, [dstend, -4]
50 strh valw, [dstend, -2]
53 /* Set 17..96 bytes. */
56 tbnz count, 6, L(set96)
64 /* Set 64..96 bytes. Write 64 bytes from the start and
65 32 bytes from the end. */
68 stp q0, q0, [dstin, 32]
69 stp q0, q0, [dstend, -32]
81 #ifndef SKIP_ZVA_CHECK
82 mrs zva_val, dczid_el0
83 and zva_val, zva_val, 31
84 cmp zva_val, 4 /* ZVA size is 64 bytes. */
90 sub count, dstend, dst /* Count is now 64 too large. */
91 sub count, count, 128 /* Adjust count and bias for loop. */
99 stp q0, q0, [dstend, -64]
100 stp q0, q0, [dstend, -32]
104 sub count, dstend, dst /* Count is 16 too large. */
105 sub dst, dst, 16 /* Dst is biased by -32. */
106 sub count, count, 64 + 16 /* Adjust count and bias for loop. */
108 stp q0, q0, [dst, 32]
109 stp q0, q0, [dst, 64]!
110 subs count, count, 64
112 stp q0, q0, [dstend, -64]
113 stp q0, q0, [dstend, -32]