]>
Commit | Line | Data |
---|---|---|
1 | /* Memset for falkor. | |
2 | Copyright (C) 2017-2019 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of the GNU C Library. | |
5 | ||
6 | The GNU C Library is free software; you can redistribute it and/or | |
7 | modify it under the terms of the GNU Lesser General Public | |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
10 | ||
11 | The GNU C Library is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | Lesser General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU Lesser General Public | |
17 | License along with the GNU C Library. If not, see | |
18 | <https://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #include <memset-reg.h> | |
21 | ||
22 | /* Reading dczid_el0 is expensive on falkor so move it into the ifunc | |
23 | resolver and assume ZVA size of 64 bytes. The IFUNC resolver takes care to | |
24 | use this function only when ZVA is enabled. */ | |
25 | ||
26 | #if IS_IN (libc) | |
27 | .macro zva_macro | |
28 | .p2align 4 | |
29 | /* Write the first and last 64 byte aligned block using stp rather | |
30 | than using DC ZVA. This is faster on some cores. */ | |
31 | str q0, [dst, 16] | |
32 | stp q0, q0, [dst, 32] | |
33 | bic dst, dst, 63 | |
34 | stp q0, q0, [dst, 64] | |
35 | stp q0, q0, [dst, 96] | |
36 | sub count, dstend, dst /* Count is now 128 too large. */ | |
37 | sub count, count, 128+64+64 /* Adjust count and bias for loop. */ | |
38 | add dst, dst, 128 | |
39 | 1: dc zva, dst | |
40 | add dst, dst, 64 | |
41 | subs count, count, 64 | |
42 | b.hi 1b | |
43 | stp q0, q0, [dst, 0] | |
44 | stp q0, q0, [dst, 32] | |
45 | stp q0, q0, [dstend, -64] | |
46 | stp q0, q0, [dstend, -32] | |
47 | ret | |
48 | .endm | |
49 | ||
50 | # define ZVA_MACRO zva_macro | |
51 | # define MEMSET __memset_falkor | |
52 | # include <sysdeps/aarch64/memset.S> | |
53 | #endif |