Debian Codegraph @

third-party/simde/arm/neon/bcax.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 Atharva Nimbalkar <[email protected]>
25 */
26
27 #if !defined(SIMDE_ARM_NEON_BCAX_H)
28 #define SIMDE_ARM_NEON_BCAX_H
29
30 #include "types.h"
31
32 #include "eor.h"
33 #include "bic.h"
34
35 HEDLEY_DIAGNOSTIC_PUSH
36 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
37 SIMDE_BEGIN_DECLS_
38
39 SIMDE_FUNCTION_ATTRIBUTES
40 simde_uint8x16_t
41 simde_vbcaxq_u8(simde_uint8x16_t a, simde_uint8x16_t b, simde_uint8x16_t c) {
42 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
43 return vbcaxq_u8(a, b, c);
44 #else
45 return simde_veorq_u8(a, simde_vbicq_u8(b, c));
46 #endif
47 }
48 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
49 #undef vbcaxq_u8
50 #define vbcaxq_u8(a, b, c) simde_vbcaxq_u8(a, b, c)
51 #endif
52
53 SIMDE_FUNCTION_ATTRIBUTES
54 simde_uint16x8_t
55 simde_vbcaxq_u16(simde_uint16x8_t a, simde_uint16x8_t b, simde_uint16x8_t c) {
56 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
57 return vbcaxq_u16(a, b, c);
58 #else
59 return simde_veorq_u16(a, simde_vbicq_u16(b, c));
60 #endif
61 }
62 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
63 #undef vbcaxq_u16
64 #define vbcaxq_u16(a, b, c) simde_vbcaxq_u16(a, b, c)
65 #endif
66
67 SIMDE_FUNCTION_ATTRIBUTES
68 simde_uint32x4_t
69 simde_vbcaxq_u32(simde_uint32x4_t a, simde_uint32x4_t b, simde_uint32x4_t c) {
70 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
71 return vbcaxq_u32(a, b, c);
72 #else
73 return simde_veorq_u32(a, simde_vbicq_u32(b, c));
74 #endif
75 }
76 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
77 #undef vbcaxq_u32
78 #define vbcaxq_u32(a, b, c) simde_vbcaxq_u32(a, b, c)
79 #endif
80
81 SIMDE_FUNCTION_ATTRIBUTES
82 simde_uint64x2_t
83 simde_vbcaxq_u64(simde_uint64x2_t a, simde_uint64x2_t b, simde_uint64x2_t c) {
84 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
85 return vbcaxq_u64(a, b, c);
86 #else
87 return simde_veorq_u64(a, simde_vbicq_u64(b, c));
88 #endif
89 }
90 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
91 #undef vbcaxq_u64
92 #define vbcaxq_u64(a, b, c) simde_vbcaxq_u64(a, b, c)
93 #endif
94
95 SIMDE_FUNCTION_ATTRIBUTES
96 simde_int8x16_t
97 simde_vbcaxq_s8(simde_int8x16_t a, simde_int8x16_t b, simde_int8x16_t c) {
98 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
99 return vbcaxq_s8(a, b, c);
100 #else
101 return simde_veorq_s8(a, simde_vbicq_s8(b, c));
102 #endif
103 }
104 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
105 #undef vbcaxq_s8
106 #define vbcaxq_s8(a, b, c) simde_vbcaxq_s8(a, b, c)
107 #endif
108
109 SIMDE_FUNCTION_ATTRIBUTES
110 simde_int16x8_t
111 simde_vbcaxq_s16(simde_int16x8_t a, simde_int16x8_t b, simde_int16x8_t c) {
112 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
113 return vbcaxq_s16(a, b, c);
114 #else
115 return simde_veorq_s16(a,simde_vbicq_s16(b, c));
116 #endif
117 }
118 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
119 #undef vbcaxq_s16
120 #define vbcaxq_s16(a, b, c) simde_vbcaxq_s16(a, b, c)
121 #endif
122
123 SIMDE_FUNCTION_ATTRIBUTES
124 simde_int32x4_t
125 simde_vbcaxq_s32(simde_int32x4_t a, simde_int32x4_t b, simde_int32x4_t c) {
126 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
127 return vbcaxq_s32(a, b, c);
128 #else
129 return simde_veorq_s32(a, simde_vbicq_s32(b, c));
130 #endif
131 }
132 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
133 #undef vbcaxq_s32
134 #define vbcaxq_s32(a, b, c) simde_vbcaxq_s32(a, b, c)
135 #endif
136
137 SIMDE_FUNCTION_ATTRIBUTES
138 simde_int64x2_t
139 simde_vbcaxq_s64(simde_int64x2_t a, simde_int64x2_t b, simde_int64x2_t c) {
140 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(__ARM_FEATURE_SHA3)
141 return vbcaxq_s64(a, b, c);
142 #else
143 return simde_veorq_s64(a, simde_vbicq_s64(b, c));
144 #endif
145 }
146 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_SHA3))
147 #undef vbcaxq_s64
148 #define vbcaxq_s64(a, b, c) simde_vbcaxq_s64(a, b, c)
149 #endif
150
151 SIMDE_END_DECLS_
152 HEDLEY_DIAGNOSTIC_POP
153
154 #endif /* !defined(SIMDE_ARM_NEON_BCAX_H) */