Debian Codegraph @

third-party/simde/arm/neon/create.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 * 2020 Evan Nemerson <[email protected]>
25 * 2020 Christopher Moore <[email protected]>
26 */
27
28 /* N.B. CM: vcreate_f16 and vcreate_bf16 are omitted as
29 * SIMDe has no 16-bit floating point support.
30 * Idem for the poly types. */
31
32 #if !defined(SIMDE_ARM_NEON_CREATE_H)
33 #define SIMDE_ARM_NEON_CREATE_H
34
35 #include "dup_n.h"
36 #include "reinterpret.h"
37 #include "types.h"
38
39 HEDLEY_DIAGNOSTIC_PUSH
40 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
41 SIMDE_BEGIN_DECLS_
42
43 SIMDE_FUNCTION_ATTRIBUTES
44 simde_int8x8_t
45 simde_vcreate_s8(uint64_t a) {
46 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
47 return vcreate_s8(a);
48 #else
49 return simde_vreinterpret_s8_u64(simde_vdup_n_u64(a));
50 #endif
51 }
52 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
53 #undef vcreate_s8
54 #define vcreate_s8(a) simde_vcreate_s8(a)
55 #endif
56
57 SIMDE_FUNCTION_ATTRIBUTES
58 simde_int16x4_t
59 simde_vcreate_s16(uint64_t a) {
60 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
61 return vcreate_s16(a);
62 #else
63 return simde_vreinterpret_s16_u64(simde_vdup_n_u64(a));
64 #endif
65 }
66 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
67 #undef vcreate_s16
68 #define vcreate_s16(a) simde_vcreate_s16(a)
69 #endif
70
71 SIMDE_FUNCTION_ATTRIBUTES
72 simde_int32x2_t
73 simde_vcreate_s32(uint64_t a) {
74 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
75 return vcreate_s32(a);
76 #else
77 return simde_vreinterpret_s32_u64(simde_vdup_n_u64(a));
78 #endif
79 }
80 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
81 #undef vcreate_s32
82 #define vcreate_s32(a) simde_vcreate_s32(a)
83 #endif
84
85 SIMDE_FUNCTION_ATTRIBUTES
86 simde_int64x1_t
87 simde_vcreate_s64(uint64_t a) {
88 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
89 return vcreate_s64(a);
90 #else
91 return simde_vreinterpret_s64_u64(simde_vdup_n_u64(a));
92 #endif
93 }
94 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
95 #undef vcreate_s64
96 #define vcreate_s64(a) simde_vcreate_s64(a)
97 #endif
98
99 SIMDE_FUNCTION_ATTRIBUTES
100 simde_uint8x8_t
101 simde_vcreate_u8(uint64_t a) {
102 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
103 return vcreate_u8(a);
104 #else
105 return simde_vreinterpret_u8_u64(simde_vdup_n_u64(a));
106 #endif
107 }
108 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
109 #undef vcreate_u8
110 #define vcreate_u8(a) simde_vcreate_u8(a)
111 #endif
112
113 SIMDE_FUNCTION_ATTRIBUTES
114 simde_uint16x4_t
115 simde_vcreate_u16(uint64_t a) {
116 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
117 return vcreate_u16(a);
118 #else
119 return simde_vreinterpret_u16_u64(simde_vdup_n_u64(a));
120 #endif
121 }
122 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
123 #undef vcreate_u16
124 #define vcreate_u16(a) simde_vcreate_u16(a)
125 #endif
126
127 SIMDE_FUNCTION_ATTRIBUTES
128 simde_uint32x2_t
129 simde_vcreate_u32(uint64_t a) {
130 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
131 return vcreate_u32(a);
132 #else
133 return simde_vreinterpret_u32_u64(simde_vdup_n_u64(a));
134 #endif
135 }
136 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
137 #undef vcreate_u32
138 #define vcreate_u32(a) simde_vcreate_u32(a)
139 #endif
140
141 SIMDE_FUNCTION_ATTRIBUTES
142 simde_uint64x1_t
143 simde_vcreate_u64(uint64_t a) {
144 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
145 return vcreate_u64(a);
146 #else
147 return simde_vdup_n_u64(a);
148 #endif
149 }
150 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
151 #undef vcreate_u64
152 #define vcreate_u64(a) simde_vcreate_u64(a)
153 #endif
154
155 SIMDE_FUNCTION_ATTRIBUTES
156 simde_float32x2_t
157 simde_vcreate_f32(uint64_t a) {
158 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
159 return vcreate_f32(a);
160 #else
161 return simde_vreinterpret_f32_u64(simde_vdup_n_u64(a));
162 #endif
163 }
164 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
165 #undef vcreate_f32
166 #define vcreate_f32(a) simde_vcreate_f32(a)
167 #endif
168
169 SIMDE_FUNCTION_ATTRIBUTES
170 simde_float64x1_t
171 simde_vcreate_f64(uint64_t a) {
172 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
173 return vcreate_f64(a);
174 #else
175 return simde_vreinterpret_f64_u64(simde_vdup_n_u64(a));
176 #endif
177 }
178 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
179 #undef vcreate_f64
180 #define vcreate_f64(a) simde_vcreate_f64(a)
181 #endif
182
183 SIMDE_END_DECLS_
184 HEDLEY_DIAGNOSTIC_POP
185
186 #endif /* !defined(SIMDE_ARM_NEON_CREATE_H) */