Debian Codegraph @

third-party/simde/arm/sve/cnt.h

raw
1 /* SPDX-License-Identifier: MIT
2 *
3 * Permission is hereby granted, free of charge, to any person
4 * obtaining a copy of this software and associated documentation
5 * files (the "Software"), to deal in the Software without
6 * restriction, including without limitation the rights to use, copy,
7 * modify, merge, publish, distribute, sublicense, and/or sell copies
8 * of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Copyright:
24 * 2021 Evan Nemerson <[email protected]>
25 */
26
27 #if !defined(SIMDE_ARM_SVE_CNT_H)
28 #define SIMDE_ARM_SVE_CNT_H
29
30 #include "types.h"
31
32 HEDLEY_DIAGNOSTIC_PUSH
33 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
34
35 SIMDE_FUNCTION_ATTRIBUTES
36 uint64_t
37 simde_svcntb(void) {
38 #if defined(SIMDE_ARM_SVE_NATIVE)
39 return svcntb();
40 #else
41 return sizeof(simde_svint8_t) / sizeof(int8_t);
42 #endif
43 }
44 #if defined(SIMDE_ARM_SVE_ENABLE_NATIVE_ALIASES)
45 #undef simde_svcntb
46 #define svcntb() simde_svcntb()
47 #endif
48
49 SIMDE_FUNCTION_ATTRIBUTES
50 uint64_t
51 simde_svcnth(void) {
52 #if defined(SIMDE_ARM_SVE_NATIVE)
53 return svcnth();
54 #else
55 return sizeof(simde_svint16_t) / sizeof(int16_t);
56 #endif
57 }
58 #if defined(SIMDE_ARM_SVE_ENABLE_NATIVE_ALIASES)
59 #undef simde_svcnth
60 #define svcnth() simde_svcnth()
61 #endif
62
63 SIMDE_FUNCTION_ATTRIBUTES
64 uint64_t
65 simde_svcntw(void) {
66 #if defined(SIMDE_ARM_SVE_NATIVE)
67 return svcntw();
68 #else
69 return sizeof(simde_svint32_t) / sizeof(int32_t);
70 #endif
71 }
72 #if defined(SIMDE_ARM_SVE_ENABLE_NATIVE_ALIASES)
73 #undef simde_svcntw
74 #define svcntw() simde_svcntw()
75 #endif
76
77 SIMDE_FUNCTION_ATTRIBUTES
78 uint64_t
79 simde_svcntd(void) {
80 #if defined(SIMDE_ARM_SVE_NATIVE)
81 return svcntd();
82 #else
83 return sizeof(simde_svint64_t) / sizeof(int64_t);
84 #endif
85 }
86 #if defined(SIMDE_ARM_SVE_ENABLE_NATIVE_ALIASES)
87 #undef simde_svcntd
88 #define svcntd() simde_svcntd()
89 #endif
90
91 HEDLEY_DIAGNOSTIC_POP
92
93 #endif /* SIMDE_ARM_SVE_CNT_H */