xref: /qemu/target/arm/tcg/vec_internal.h (revision 50f57e09fda4b7ffbc5ba62aad6cebf660824023)
1a04b68e1SRichard Henderson /*
2a04b68e1SRichard Henderson  * ARM AdvSIMD / SVE Vector Helpers
3a04b68e1SRichard Henderson  *
4a04b68e1SRichard Henderson  * Copyright (c) 2020 Linaro
5a04b68e1SRichard Henderson  *
6a04b68e1SRichard Henderson  * This library is free software; you can redistribute it and/or
7a04b68e1SRichard Henderson  * modify it under the terms of the GNU Lesser General Public
8a04b68e1SRichard Henderson  * License as published by the Free Software Foundation; either
9*50f57e09SChetan Pant  * version 2.1 of the License, or (at your option) any later version.
10a04b68e1SRichard Henderson  *
11a04b68e1SRichard Henderson  * This library is distributed in the hope that it will be useful,
12a04b68e1SRichard Henderson  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13a04b68e1SRichard Henderson  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14a04b68e1SRichard Henderson  * Lesser General Public License for more details.
15a04b68e1SRichard Henderson  *
16a04b68e1SRichard Henderson  * You should have received a copy of the GNU Lesser General Public
17a04b68e1SRichard Henderson  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18a04b68e1SRichard Henderson  */
19a04b68e1SRichard Henderson 
20a04b68e1SRichard Henderson #ifndef TARGET_ARM_VEC_INTERNALS_H
21a04b68e1SRichard Henderson #define TARGET_ARM_VEC_INTERNALS_H
22a04b68e1SRichard Henderson 
23a04b68e1SRichard Henderson static inline void clear_tail(void *vd, uintptr_t opr_sz, uintptr_t max_sz)
24a04b68e1SRichard Henderson {
25a04b68e1SRichard Henderson     uint64_t *d = vd + opr_sz;
26a04b68e1SRichard Henderson     uintptr_t i;
27a04b68e1SRichard Henderson 
28a04b68e1SRichard Henderson     for (i = opr_sz; i < max_sz; i += 8) {
29a04b68e1SRichard Henderson         *d++ = 0;
30a04b68e1SRichard Henderson     }
31a04b68e1SRichard Henderson }
32a04b68e1SRichard Henderson 
33a04b68e1SRichard Henderson #endif /* TARGET_ARM_VEC_INTERNALS_H */
34