Debian Codegraph @

third-party/simde/x86/avx512/ternarylogic.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 Kunwar Maheep Singh <[email protected]>
25 * 2021 Christopher Moore <[email protected]>
26 */
27
28 /* The ternarylogic implementation is based on Wojciech Muła's work at
29 * https://github.com/WojciechMula/ternary-logic */
30
31 #if !defined(SIMDE_X86_AVX512_TERNARYLOGIC_H)
32 #define SIMDE_X86_AVX512_TERNARYLOGIC_H
33
34 #include "types.h"
35 #include "movm.h"
36 #include "mov.h"
37
38 HEDLEY_DIAGNOSTIC_PUSH
39 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
40 SIMDE_BEGIN_DECLS_
41
42 SIMDE_FUNCTION_ATTRIBUTES
43 uint_fast32_t
44 simde_x_ternarylogic_0x00_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
45 HEDLEY_STATIC_CAST(void, a);
46 HEDLEY_STATIC_CAST(void, b);
47 HEDLEY_STATIC_CAST(void, c);
48 const uint_fast32_t c0 = 0;
49 return c0;
50 }
51
52 SIMDE_FUNCTION_ATTRIBUTES
53 uint_fast32_t
54 simde_x_ternarylogic_0x01_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
55 const uint_fast32_t t0 = b | c;
56 const uint_fast32_t t1 = a | t0;
57 const uint_fast32_t t2 = ~t1;
58 return t2;
59 }
60
61 SIMDE_FUNCTION_ATTRIBUTES
62 uint_fast32_t
63 simde_x_ternarylogic_0x02_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
64 const uint_fast32_t t0 = b | a;
65 const uint_fast32_t t1 = ~t0;
66 const uint_fast32_t t2 = c & t1;
67 return t2;
68 }
69
70 SIMDE_FUNCTION_ATTRIBUTES
71 uint_fast32_t
72 simde_x_ternarylogic_0x03_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
73 HEDLEY_STATIC_CAST(void, c);
74 const uint_fast32_t t0 = b | a;
75 const uint_fast32_t t1 = ~t0;
76 return t1;
77 }
78
79 SIMDE_FUNCTION_ATTRIBUTES
80 uint_fast32_t
81 simde_x_ternarylogic_0x04_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
82 const uint_fast32_t t0 = a | c;
83 const uint_fast32_t t1 = ~t0;
84 const uint_fast32_t t2 = b & t1;
85 return t2;
86 }
87
88 SIMDE_FUNCTION_ATTRIBUTES
89 uint_fast32_t
90 simde_x_ternarylogic_0x05_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
91 HEDLEY_STATIC_CAST(void, b);
92 const uint_fast32_t t0 = c | a;
93 const uint_fast32_t t1 = ~t0;
94 return t1;
95 }
96
97 SIMDE_FUNCTION_ATTRIBUTES
98 uint_fast32_t
99 simde_x_ternarylogic_0x06_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
100 const uint_fast32_t t0 = ~a;
101 const uint_fast32_t t1 = b ^ c;
102 const uint_fast32_t t2 = t0 & t1;
103 return t2;
104 }
105
106 SIMDE_FUNCTION_ATTRIBUTES
107 uint_fast32_t
108 simde_x_ternarylogic_0x07_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
109 const uint_fast32_t t0 = b & c;
110 const uint_fast32_t t1 = a | t0;
111 const uint_fast32_t t2 = ~t1;
112 return t2;
113 }
114
115 SIMDE_FUNCTION_ATTRIBUTES
116 uint_fast32_t
117 simde_x_ternarylogic_0x08_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
118 const uint_fast32_t t0 = ~a;
119 const uint_fast32_t t1 = t0 & b;
120 const uint_fast32_t t2 = t1 & c;
121 return t2;
122 }
123
124 SIMDE_FUNCTION_ATTRIBUTES
125 uint_fast32_t
126 simde_x_ternarylogic_0x09_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
127 const uint_fast32_t t0 = b ^ c;
128 const uint_fast32_t t1 = a | t0;
129 const uint_fast32_t t2 = ~t1;
130 return t2;
131 }
132
133 SIMDE_FUNCTION_ATTRIBUTES
134 uint_fast32_t
135 simde_x_ternarylogic_0x0a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
136 HEDLEY_STATIC_CAST(void, b);
137 const uint_fast32_t t0 = ~a;
138 const uint_fast32_t t1 = c & t0;
139 return t1;
140 }
141
142 SIMDE_FUNCTION_ATTRIBUTES
143 uint_fast32_t
144 simde_x_ternarylogic_0x0b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
145 const uint_fast32_t t0 = ~a;
146 const uint_fast32_t t1 = ~b;
147 const uint_fast32_t t2 = t1 | c;
148 const uint_fast32_t t3 = t0 & t2;
149 return t3;
150 }
151
152 SIMDE_FUNCTION_ATTRIBUTES
153 uint_fast32_t
154 simde_x_ternarylogic_0x0c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
155 HEDLEY_STATIC_CAST(void, c);
156 const uint_fast32_t t0 = ~a;
157 const uint_fast32_t t1 = b & t0;
158 return t1;
159 }
160
161 SIMDE_FUNCTION_ATTRIBUTES
162 uint_fast32_t
163 simde_x_ternarylogic_0x0d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
164 const uint_fast32_t t0 = ~a;
165 const uint_fast32_t t1 = ~c;
166 const uint_fast32_t t2 = t1 | b;
167 const uint_fast32_t t3 = t0 & t2;
168 return t3;
169 }
170
171 SIMDE_FUNCTION_ATTRIBUTES
172 uint_fast32_t
173 simde_x_ternarylogic_0x0e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
174 const uint_fast32_t t0 = ~a;
175 const uint_fast32_t t1 = b | c;
176 const uint_fast32_t t2 = t0 & t1;
177 return t2;
178 }
179
180 SIMDE_FUNCTION_ATTRIBUTES
181 uint_fast32_t
182 simde_x_ternarylogic_0x0f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
183 HEDLEY_STATIC_CAST(void, b);
184 HEDLEY_STATIC_CAST(void, c);
185 const uint_fast32_t t0 = ~a;
186 return t0;
187 }
188
189 SIMDE_FUNCTION_ATTRIBUTES
190 uint_fast32_t
191 simde_x_ternarylogic_0x10_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
192 const uint_fast32_t t0 = b | c;
193 const uint_fast32_t t1 = ~t0;
194 const uint_fast32_t t2 = a & t1;
195 return t2;
196 }
197
198 SIMDE_FUNCTION_ATTRIBUTES
199 uint_fast32_t
200 simde_x_ternarylogic_0x11_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
201 HEDLEY_STATIC_CAST(void, a);
202 const uint_fast32_t t0 = c | b;
203 const uint_fast32_t t1 = ~t0;
204 return t1;
205 }
206
207 SIMDE_FUNCTION_ATTRIBUTES
208 uint_fast32_t
209 simde_x_ternarylogic_0x12_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
210 const uint_fast32_t t0 = ~b;
211 const uint_fast32_t t1 = a ^ c;
212 const uint_fast32_t t2 = t0 & t1;
213 return t2;
214 }
215
216 SIMDE_FUNCTION_ATTRIBUTES
217 uint_fast32_t
218 simde_x_ternarylogic_0x13_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
219 const uint_fast32_t t0 = a & c;
220 const uint_fast32_t t1 = b | t0;
221 const uint_fast32_t t2 = ~t1;
222 return t2;
223 }
224
225 SIMDE_FUNCTION_ATTRIBUTES
226 uint_fast32_t
227 simde_x_ternarylogic_0x14_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
228 const uint_fast32_t t0 = ~c;
229 const uint_fast32_t t1 = a ^ b;
230 const uint_fast32_t t2 = t0 & t1;
231 return t2;
232 }
233
234 SIMDE_FUNCTION_ATTRIBUTES
235 uint_fast32_t
236 simde_x_ternarylogic_0x15_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
237 const uint_fast32_t t0 = b & a;
238 const uint_fast32_t t1 = c | t0;
239 const uint_fast32_t t2 = ~t1;
240 return t2;
241 }
242
243 SIMDE_FUNCTION_ATTRIBUTES
244 uint_fast32_t
245 simde_x_ternarylogic_0x16_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
246 const uint_fast32_t t0 = b | c;
247 const uint_fast32_t t1 = ~t0;
248 const uint_fast32_t t2 = a & t1;
249 const uint_fast32_t t3 = ~a;
250 const uint_fast32_t t4 = b ^ c;
251 const uint_fast32_t t5 = t3 & t4;
252 const uint_fast32_t t6 = t2 | t5;
253 return t6;
254 }
255
256 SIMDE_FUNCTION_ATTRIBUTES
257 uint_fast32_t
258 simde_x_ternarylogic_0x17_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
259 const uint_fast32_t t0 = b | c;
260 const uint_fast32_t t1 = b & c;
261 const uint_fast32_t t2 = (a & t0) | (~a & t1);
262 const uint_fast32_t t3 = ~t2;
263 return t3;
264 }
265
266 SIMDE_FUNCTION_ATTRIBUTES
267 uint_fast32_t
268 simde_x_ternarylogic_0x18_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
269 const uint_fast32_t t0 = a ^ b;
270 const uint_fast32_t t1 = a ^ c;
271 const uint_fast32_t t2 = t0 & t1;
272 return t2;
273 }
274
275 SIMDE_FUNCTION_ATTRIBUTES
276 uint_fast32_t
277 simde_x_ternarylogic_0x19_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
278 const uint_fast32_t t0 = b ^ c;
279 const uint_fast32_t t1 = b & c;
280 const uint_fast32_t t2 = a & t1;
281 const uint_fast32_t t3 = t0 ^ t2;
282 const uint_fast32_t t4 = ~t3;
283 return t4;
284 }
285
286 SIMDE_FUNCTION_ATTRIBUTES
287 uint_fast32_t
288 simde_x_ternarylogic_0x1a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
289 const uint_fast32_t t0 = a & b;
290 const uint_fast32_t t1 = ~t0;
291 const uint_fast32_t t2 = a ^ c;
292 const uint_fast32_t t3 = t1 & t2;
293 return t3;
294 }
295
296 SIMDE_FUNCTION_ATTRIBUTES
297 uint_fast32_t
298 simde_x_ternarylogic_0x1b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
299 const uint_fast32_t t0 = a & c;
300 const uint_fast32_t t1 = ~b;
301 const uint_fast32_t t2 = t1 | c;
302 const uint_fast32_t t3 = t0 ^ t2;
303 return t3;
304 }
305
306 SIMDE_FUNCTION_ATTRIBUTES
307 uint_fast32_t
308 simde_x_ternarylogic_0x1c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
309 const uint_fast32_t t0 = a & c;
310 const uint_fast32_t t1 = ~t0;
311 const uint_fast32_t t2 = a ^ b;
312 const uint_fast32_t t3 = t1 & t2;
313 return t3;
314 }
315
316 SIMDE_FUNCTION_ATTRIBUTES
317 uint_fast32_t
318 simde_x_ternarylogic_0x1d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
319 const uint_fast32_t t0 = a & b;
320 const uint_fast32_t t1 = ~c;
321 const uint_fast32_t t2 = t1 | b;
322 const uint_fast32_t t3 = t0 ^ t2;
323 return t3;
324 }
325
326 SIMDE_FUNCTION_ATTRIBUTES
327 uint_fast32_t
328 simde_x_ternarylogic_0x1e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
329 const uint_fast32_t t0 = b | c;
330 const uint_fast32_t t1 = a ^ t0;
331 return t1;
332 }
333
334 SIMDE_FUNCTION_ATTRIBUTES
335 uint_fast32_t
336 simde_x_ternarylogic_0x1f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
337 const uint_fast32_t t0 = b | c;
338 const uint_fast32_t t1 = a & t0;
339 const uint_fast32_t t2 = ~t1;
340 return t2;
341 }
342
343 SIMDE_FUNCTION_ATTRIBUTES
344 uint_fast32_t
345 simde_x_ternarylogic_0x20_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
346 const uint_fast32_t t0 = ~b;
347 const uint_fast32_t t1 = t0 & a;
348 const uint_fast32_t t2 = t1 & c;
349 return t2;
350 }
351
352 SIMDE_FUNCTION_ATTRIBUTES
353 uint_fast32_t
354 simde_x_ternarylogic_0x21_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
355 const uint_fast32_t t0 = a ^ c;
356 const uint_fast32_t t1 = b | t0;
357 const uint_fast32_t t2 = ~t1;
358 return t2;
359 }
360
361 SIMDE_FUNCTION_ATTRIBUTES
362 uint_fast32_t
363 simde_x_ternarylogic_0x22_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
364 HEDLEY_STATIC_CAST(void, a);
365 const uint_fast32_t t0 = ~b;
366 const uint_fast32_t t1 = c & t0;
367 return t1;
368 }
369
370 SIMDE_FUNCTION_ATTRIBUTES
371 uint_fast32_t
372 simde_x_ternarylogic_0x23_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
373 const uint_fast32_t t0 = ~b;
374 const uint_fast32_t t1 = ~a;
375 const uint_fast32_t t2 = t1 | c;
376 const uint_fast32_t t3 = t0 & t2;
377 return t3;
378 }
379
380 SIMDE_FUNCTION_ATTRIBUTES
381 uint_fast32_t
382 simde_x_ternarylogic_0x24_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
383 const uint_fast32_t t0 = a ^ b;
384 const uint_fast32_t t1 = b ^ c;
385 const uint_fast32_t t2 = t0 & t1;
386 return t2;
387 }
388
389 SIMDE_FUNCTION_ATTRIBUTES
390 uint_fast32_t
391 simde_x_ternarylogic_0x25_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
392 const uint_fast32_t t0 = a & b;
393 const uint_fast32_t t1 = ~t0;
394 const uint_fast32_t t2 = ~c;
395 const uint_fast32_t t3 = a ^ t2;
396 const uint_fast32_t t4 = t1 & t3;
397 return t4;
398 }
399
400 SIMDE_FUNCTION_ATTRIBUTES
401 uint_fast32_t
402 simde_x_ternarylogic_0x26_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
403 const uint_fast32_t t0 = a & b;
404 const uint_fast32_t t1 = ~t0;
405 const uint_fast32_t t2 = b ^ c;
406 const uint_fast32_t t3 = t1 & t2;
407 return t3;
408 }
409
410 SIMDE_FUNCTION_ATTRIBUTES
411 uint_fast32_t
412 simde_x_ternarylogic_0x27_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
413 const uint_fast32_t t0 = b & c;
414 const uint_fast32_t t1 = ~a;
415 const uint_fast32_t t2 = t1 | c;
416 const uint_fast32_t t3 = t0 ^ t2;
417 return t3;
418 }
419
420 SIMDE_FUNCTION_ATTRIBUTES
421 uint_fast32_t
422 simde_x_ternarylogic_0x28_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
423 const uint_fast32_t t0 = b ^ a;
424 const uint_fast32_t t1 = c & t0;
425 return t1;
426 }
427
428 SIMDE_FUNCTION_ATTRIBUTES
429 uint_fast32_t
430 simde_x_ternarylogic_0x29_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
431 const uint_fast32_t t0 = ~a;
432 const uint_fast32_t t1 = t0 | c;
433 const uint_fast32_t t2 = ~a;
434 const uint_fast32_t t3 = b ^ c;
435 const uint_fast32_t t4 = t2 ^ t3;
436 const uint_fast32_t t5 = t1 & t4;
437 return t5;
438 }
439
440 SIMDE_FUNCTION_ATTRIBUTES
441 uint_fast32_t
442 simde_x_ternarylogic_0x2a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
443 const uint_fast32_t t0 = b & a;
444 const uint_fast32_t t1 = ~t0;
445 const uint_fast32_t t2 = c & t1;
446 return t2;
447 }
448
449 SIMDE_FUNCTION_ATTRIBUTES
450 uint_fast32_t
451 simde_x_ternarylogic_0x2b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
452 const uint_fast32_t t0 = b & a;
453 const uint_fast32_t t1 = ~t0;
454 const uint_fast32_t t2 = c & t1;
455 const uint_fast32_t t3 = ~c;
456 const uint_fast32_t t4 = b | a;
457 const uint_fast32_t t5 = ~t4;
458 const uint_fast32_t t6 = t3 & t5;
459 const uint_fast32_t t7 = t2 | t6;
460 return t7;
461 }
462
463 SIMDE_FUNCTION_ATTRIBUTES
464 uint_fast32_t
465 simde_x_ternarylogic_0x2c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
466 const uint_fast32_t t0 = b | c;
467 const uint_fast32_t t1 = a ^ b;
468 const uint_fast32_t t2 = t0 & t1;
469 return t2;
470 }
471
472 SIMDE_FUNCTION_ATTRIBUTES
473 uint_fast32_t
474 simde_x_ternarylogic_0x2d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
475 const uint_fast32_t t0 = ~c;
476 const uint_fast32_t t1 = b | t0;
477 const uint_fast32_t t2 = a ^ t1;
478 return t2;
479 }
480
481 SIMDE_FUNCTION_ATTRIBUTES
482 uint_fast32_t
483 simde_x_ternarylogic_0x2e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
484 const uint_fast32_t t0 = b | c;
485 const uint_fast32_t t1 = a & b;
486 const uint_fast32_t t2 = t0 ^ t1;
487 return t2;
488 }
489
490 SIMDE_FUNCTION_ATTRIBUTES
491 uint_fast32_t
492 simde_x_ternarylogic_0x2f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
493 const uint_fast32_t t0 = ~a;
494 const uint_fast32_t t1 = ~b;
495 const uint_fast32_t t2 = t1 & c;
496 const uint_fast32_t t3 = t0 | t2;
497 return t3;
498 }
499
500 SIMDE_FUNCTION_ATTRIBUTES
501 uint_fast32_t
502 simde_x_ternarylogic_0x30_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
503 HEDLEY_STATIC_CAST(void, c);
504 const uint_fast32_t t0 = ~b;
505 const uint_fast32_t t1 = a & t0;
506 return t1;
507 }
508
509 SIMDE_FUNCTION_ATTRIBUTES
510 uint_fast32_t
511 simde_x_ternarylogic_0x31_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
512 const uint_fast32_t t0 = ~b;
513 const uint_fast32_t t1 = ~c;
514 const uint_fast32_t t2 = t1 | a;
515 const uint_fast32_t t3 = t0 & t2;
516 return t3;
517 }
518
519 SIMDE_FUNCTION_ATTRIBUTES
520 uint_fast32_t
521 simde_x_ternarylogic_0x32_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
522 const uint_fast32_t t0 = ~b;
523 const uint_fast32_t t1 = a | c;
524 const uint_fast32_t t2 = t0 & t1;
525 return t2;
526 }
527
528 SIMDE_FUNCTION_ATTRIBUTES
529 uint_fast32_t
530 simde_x_ternarylogic_0x33_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
531 HEDLEY_STATIC_CAST(void, a);
532 HEDLEY_STATIC_CAST(void, c);
533 const uint_fast32_t t0 = ~b;
534 return t0;
535 }
536
537 SIMDE_FUNCTION_ATTRIBUTES
538 uint_fast32_t
539 simde_x_ternarylogic_0x34_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
540 const uint_fast32_t t0 = b & c;
541 const uint_fast32_t t1 = ~t0;
542 const uint_fast32_t t2 = a ^ b;
543 const uint_fast32_t t3 = t1 & t2;
544 return t3;
545 }
546
547 SIMDE_FUNCTION_ATTRIBUTES
548 uint_fast32_t
549 simde_x_ternarylogic_0x35_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
550 const uint_fast32_t t0 = a & b;
551 const uint_fast32_t t1 = ~c;
552 const uint_fast32_t t2 = t1 | a;
553 const uint_fast32_t t3 = t0 ^ t2;
554 return t3;
555 }
556
557 SIMDE_FUNCTION_ATTRIBUTES
558 uint_fast32_t
559 simde_x_ternarylogic_0x36_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
560 const uint_fast32_t t0 = a | c;
561 const uint_fast32_t t1 = b ^ t0;
562 return t1;
563 }
564
565 SIMDE_FUNCTION_ATTRIBUTES
566 uint_fast32_t
567 simde_x_ternarylogic_0x37_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
568 const uint_fast32_t t0 = a | c;
569 const uint_fast32_t t1 = b & t0;
570 const uint_fast32_t t2 = ~t1;
571 return t2;
572 }
573
574 SIMDE_FUNCTION_ATTRIBUTES
575 uint_fast32_t
576 simde_x_ternarylogic_0x38_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
577 const uint_fast32_t t0 = a | c;
578 const uint_fast32_t t1 = a ^ b;
579 const uint_fast32_t t2 = t0 & t1;
580 return t2;
581 }
582
583 SIMDE_FUNCTION_ATTRIBUTES
584 uint_fast32_t
585 simde_x_ternarylogic_0x39_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
586 const uint_fast32_t t0 = ~c;
587 const uint_fast32_t t1 = t0 | a;
588 const uint_fast32_t t2 = b ^ t1;
589 return t2;
590 }
591
592 SIMDE_FUNCTION_ATTRIBUTES
593 uint_fast32_t
594 simde_x_ternarylogic_0x3a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
595 const uint_fast32_t t0 = ~b;
596 const uint_fast32_t t1 = a & t0;
597 const uint_fast32_t t2 = ~a;
598 const uint_fast32_t t3 = t2 & c;
599 const uint_fast32_t t4 = t1 | t3;
600 return t4;
601 }
602
603 SIMDE_FUNCTION_ATTRIBUTES
604 uint_fast32_t
605 simde_x_ternarylogic_0x3b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
606 const uint_fast32_t t0 = ~b;
607 const uint_fast32_t t1 = ~a;
608 const uint_fast32_t t2 = t1 & c;
609 const uint_fast32_t t3 = t0 | t2;
610 return t3;
611 }
612
613 SIMDE_FUNCTION_ATTRIBUTES
614 uint_fast32_t
615 simde_x_ternarylogic_0x3c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
616 HEDLEY_STATIC_CAST(void, c);
617 const uint_fast32_t t0 = b ^ a;
618 return t0;
619 }
620
621 SIMDE_FUNCTION_ATTRIBUTES
622 uint_fast32_t
623 simde_x_ternarylogic_0x3d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
624 const uint_fast32_t t0 = a ^ b;
625 const uint_fast32_t t1 = a | c;
626 const uint_fast32_t t2 = ~t1;
627 const uint_fast32_t t3 = t0 | t2;
628 return t3;
629 }
630
631 SIMDE_FUNCTION_ATTRIBUTES
632 uint_fast32_t
633 simde_x_ternarylogic_0x3e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
634 const uint_fast32_t t0 = ~a;
635 const uint_fast32_t t1 = t0 & c;
636 const uint_fast32_t t2 = a ^ b;
637 const uint_fast32_t t3 = t1 | t2;
638 return t3;
639 }
640
641 SIMDE_FUNCTION_ATTRIBUTES
642 uint_fast32_t
643 simde_x_ternarylogic_0x3f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
644 HEDLEY_STATIC_CAST(void, c);
645 const uint_fast32_t t0 = b & a;
646 const uint_fast32_t t1 = ~t0;
647 return t1;
648 }
649
650 SIMDE_FUNCTION_ATTRIBUTES
651 uint_fast32_t
652 simde_x_ternarylogic_0x40_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
653 const uint_fast32_t t0 = ~c;
654 const uint_fast32_t t1 = t0 & a;
655 const uint_fast32_t t2 = t1 & b;
656 return t2;
657 }
658
659 SIMDE_FUNCTION_ATTRIBUTES
660 uint_fast32_t
661 simde_x_ternarylogic_0x41_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
662 const uint_fast32_t t0 = b ^ a;
663 const uint_fast32_t t1 = c | t0;
664 const uint_fast32_t t2 = ~t1;
665 return t2;
666 }
667
668 SIMDE_FUNCTION_ATTRIBUTES
669 uint_fast32_t
670 simde_x_ternarylogic_0x42_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
671 const uint_fast32_t t0 = a ^ c;
672 const uint_fast32_t t1 = b ^ c;
673 const uint_fast32_t t2 = t0 & t1;
674 return t2;
675 }
676
677 SIMDE_FUNCTION_ATTRIBUTES
678 uint_fast32_t
679 simde_x_ternarylogic_0x43_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
680 const uint_fast32_t t0 = a & c;
681 const uint_fast32_t t1 = ~t0;
682 const uint_fast32_t t2 = ~b;
683 const uint_fast32_t t3 = a ^ t2;
684 const uint_fast32_t t4 = t1 & t3;
685 return t4;
686 }
687
688 SIMDE_FUNCTION_ATTRIBUTES
689 uint_fast32_t
690 simde_x_ternarylogic_0x44_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
691 HEDLEY_STATIC_CAST(void, a);
692 const uint_fast32_t t0 = ~c;
693 const uint_fast32_t t1 = b & t0;
694 return t1;
695 }
696
697 SIMDE_FUNCTION_ATTRIBUTES
698 uint_fast32_t
699 simde_x_ternarylogic_0x45_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
700 const uint_fast32_t t0 = ~c;
701 const uint_fast32_t t1 = ~a;
702 const uint_fast32_t t2 = t1 | b;
703 const uint_fast32_t t3 = t0 & t2;
704 return t3;
705 }
706
707 SIMDE_FUNCTION_ATTRIBUTES
708 uint_fast32_t
709 simde_x_ternarylogic_0x46_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
710 const uint_fast32_t t0 = a & c;
711 const uint_fast32_t t1 = ~t0;
712 const uint_fast32_t t2 = b ^ c;
713 const uint_fast32_t t3 = t1 & t2;
714 return t3;
715 }
716
717 SIMDE_FUNCTION_ATTRIBUTES
718 uint_fast32_t
719 simde_x_ternarylogic_0x47_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
720 const uint_fast32_t t0 = b & c;
721 const uint_fast32_t t1 = ~a;
722 const uint_fast32_t t2 = t1 | b;
723 const uint_fast32_t t3 = t0 ^ t2;
724 return t3;
725 }
726
727 SIMDE_FUNCTION_ATTRIBUTES
728 uint_fast32_t
729 simde_x_ternarylogic_0x48_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
730 const uint_fast32_t t0 = a ^ c;
731 const uint_fast32_t t1 = b & t0;
732 return t1;
733 }
734
735 SIMDE_FUNCTION_ATTRIBUTES
736 uint_fast32_t
737 simde_x_ternarylogic_0x49_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
738 const uint_fast32_t t0 = ~a;
739 const uint_fast32_t t1 = t0 | b;
740 const uint_fast32_t t2 = ~a;
741 const uint_fast32_t t3 = b ^ c;
742 const uint_fast32_t t4 = t2 ^ t3;
743 const uint_fast32_t t5 = t1 & t4;
744 return t5;
745 }
746
747 SIMDE_FUNCTION_ATTRIBUTES
748 uint_fast32_t
749 simde_x_ternarylogic_0x4a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
750 const uint_fast32_t t0 = b | c;
751 const uint_fast32_t t1 = a ^ c;
752 const uint_fast32_t t2 = t0 & t1;
753 return t2;
754 }
755
756 SIMDE_FUNCTION_ATTRIBUTES
757 uint_fast32_t
758 simde_x_ternarylogic_0x4b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
759 const uint_fast32_t t0 = ~b;
760 const uint_fast32_t t1 = t0 | c;
761 const uint_fast32_t t2 = a ^ t1;
762 return t2;
763 }
764
765 SIMDE_FUNCTION_ATTRIBUTES
766 uint_fast32_t
767 simde_x_ternarylogic_0x4c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
768 const uint_fast32_t t0 = a & c;
769 const uint_fast32_t t1 = ~t0;
770 const uint_fast32_t t2 = b & t1;
771 return t2;
772 }
773
774 SIMDE_FUNCTION_ATTRIBUTES
775 uint_fast32_t
776 simde_x_ternarylogic_0x4d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
777 const uint_fast32_t t0 = a & c;
778 const uint_fast32_t t1 = ~t0;
779 const uint_fast32_t t2 = b & t1;
780 const uint_fast32_t t3 = ~b;
781 const uint_fast32_t t4 = a | c;
782 const uint_fast32_t t5 = ~t4;
783 const uint_fast32_t t6 = t3 & t5;
784 const uint_fast32_t t7 = t2 | t6;
785 return t7;
786 }
787
788 SIMDE_FUNCTION_ATTRIBUTES
789 uint_fast32_t
790 simde_x_ternarylogic_0x4e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
791 const uint_fast32_t t0 = ~a;
792 const uint_fast32_t t1 = c & t0;
793 const uint_fast32_t t2 = ~c;
794 const uint_fast32_t t3 = t2 & b;
795 const uint_fast32_t t4 = t1 | t3;
796 return t4;
797 }
798
799 SIMDE_FUNCTION_ATTRIBUTES
800 uint_fast32_t
801 simde_x_ternarylogic_0x4f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
802 const uint_fast32_t t0 = ~a;
803 const uint_fast32_t t1 = ~c;
804 const uint_fast32_t t2 = b & t1;
805 const uint_fast32_t t3 = t0 | t2;
806 return t3;
807 }
808
809 SIMDE_FUNCTION_ATTRIBUTES
810 uint_fast32_t
811 simde_x_ternarylogic_0x50_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
812 HEDLEY_STATIC_CAST(void, b);
813 const uint_fast32_t t0 = ~c;
814 const uint_fast32_t t1 = a & t0;
815 return t1;
816 }
817
818 SIMDE_FUNCTION_ATTRIBUTES
819 uint_fast32_t
820 simde_x_ternarylogic_0x51_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
821 const uint_fast32_t t0 = ~c;
822 const uint_fast32_t t1 = ~b;
823 const uint_fast32_t t2 = t1 | a;
824 const uint_fast32_t t3 = t0 & t2;
825 return t3;
826 }
827
828 SIMDE_FUNCTION_ATTRIBUTES
829 uint_fast32_t
830 simde_x_ternarylogic_0x52_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
831 const uint_fast32_t t0 = b & c;
832 const uint_fast32_t t1 = ~t0;
833 const uint_fast32_t t2 = a ^ c;
834 const uint_fast32_t t3 = t1 & t2;
835 return t3;
836 }
837
838 SIMDE_FUNCTION_ATTRIBUTES
839 uint_fast32_t
840 simde_x_ternarylogic_0x53_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
841 const uint_fast32_t t0 = a & c;
842 const uint_fast32_t t1 = ~b;
843 const uint_fast32_t t2 = t1 | a;
844 const uint_fast32_t t3 = t0 ^ t2;
845 return t3;
846 }
847
848 SIMDE_FUNCTION_ATTRIBUTES
849 uint_fast32_t
850 simde_x_ternarylogic_0x54_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
851 const uint_fast32_t t0 = ~c;
852 const uint_fast32_t t1 = a | b;
853 const uint_fast32_t t2 = t0 & t1;
854 return t2;
855 }
856
857 SIMDE_FUNCTION_ATTRIBUTES
858 uint_fast32_t
859 simde_x_ternarylogic_0x55_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
860 HEDLEY_STATIC_CAST(void, a);
861 HEDLEY_STATIC_CAST(void, b);
862 const uint_fast32_t t0 = ~c;
863 return t0;
864 }
865
866 SIMDE_FUNCTION_ATTRIBUTES
867 uint_fast32_t
868 simde_x_ternarylogic_0x56_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
869 const uint_fast32_t t0 = b | a;
870 const uint_fast32_t t1 = c ^ t0;
871 return t1;
872 }
873
874 SIMDE_FUNCTION_ATTRIBUTES
875 uint_fast32_t
876 simde_x_ternarylogic_0x57_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
877 const uint_fast32_t t0 = b | a;
878 const uint_fast32_t t1 = c & t0;
879 const uint_fast32_t t2 = ~t1;
880 return t2;
881 }
882
883 SIMDE_FUNCTION_ATTRIBUTES
884 uint_fast32_t
885 simde_x_ternarylogic_0x58_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
886 const uint_fast32_t t0 = a | b;
887 const uint_fast32_t t1 = a ^ c;
888 const uint_fast32_t t2 = t0 & t1;
889 return t2;
890 }
891
892 SIMDE_FUNCTION_ATTRIBUTES
893 uint_fast32_t
894 simde_x_ternarylogic_0x59_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
895 const uint_fast32_t t0 = ~b;
896 const uint_fast32_t t1 = t0 | a;
897 const uint_fast32_t t2 = c ^ t1;
898 return t2;
899 }
900
901 SIMDE_FUNCTION_ATTRIBUTES
902 uint_fast32_t
903 simde_x_ternarylogic_0x5a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
904 HEDLEY_STATIC_CAST(void, b);
905 const uint_fast32_t t0 = c ^ a;
906 return t0;
907 }
908
909 SIMDE_FUNCTION_ATTRIBUTES
910 uint_fast32_t
911 simde_x_ternarylogic_0x5b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
912 const uint_fast32_t t0 = a | b;
913 const uint_fast32_t t1 = ~t0;
914 const uint_fast32_t t2 = a ^ c;
915 const uint_fast32_t t3 = t1 | t2;
916 return t3;
917 }
918
919 SIMDE_FUNCTION_ATTRIBUTES
920 uint_fast32_t
921 simde_x_ternarylogic_0x5c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
922 const uint_fast32_t t0 = ~c;
923 const uint_fast32_t t1 = a & t0;
924 const uint_fast32_t t2 = ~a;
925 const uint_fast32_t t3 = t2 & b;
926 const uint_fast32_t t4 = t1 | t3;
927 return t4;
928 }
929
930 SIMDE_FUNCTION_ATTRIBUTES
931 uint_fast32_t
932 simde_x_ternarylogic_0x5d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
933 const uint_fast32_t t0 = ~c;
934 const uint_fast32_t t1 = ~a;
935 const uint_fast32_t t2 = t1 & b;
936 const uint_fast32_t t3 = t0 | t2;
937 return t3;
938 }
939
940 SIMDE_FUNCTION_ATTRIBUTES
941 uint_fast32_t
942 simde_x_ternarylogic_0x5e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
943 const uint_fast32_t t0 = ~c;
944 const uint_fast32_t t1 = t0 & b;
945 const uint_fast32_t t2 = a ^ c;
946 const uint_fast32_t t3 = t1 | t2;
947 return t3;
948 }
949
950 SIMDE_FUNCTION_ATTRIBUTES
951 uint_fast32_t
952 simde_x_ternarylogic_0x5f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
953 HEDLEY_STATIC_CAST(void, b);
954 const uint_fast32_t t0 = c & a;
955 const uint_fast32_t t1 = ~t0;
956 return t1;
957 }
958
959 SIMDE_FUNCTION_ATTRIBUTES
960 uint_fast32_t
961 simde_x_ternarylogic_0x60_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
962 const uint_fast32_t t0 = b ^ c;
963 const uint_fast32_t t1 = a & t0;
964 return t1;
965 }
966
967 SIMDE_FUNCTION_ATTRIBUTES
968 uint_fast32_t
969 simde_x_ternarylogic_0x61_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
970 const uint_fast32_t t0 = ~b;
971 const uint_fast32_t t1 = t0 | a;
972 const uint_fast32_t t2 = ~b;
973 const uint_fast32_t t3 = a ^ c;
974 const uint_fast32_t t4 = t2 ^ t3;
975 const uint_fast32_t t5 = t1 & t4;
976 return t5;
977 }
978
979 SIMDE_FUNCTION_ATTRIBUTES
980 uint_fast32_t
981 simde_x_ternarylogic_0x62_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
982 const uint_fast32_t t0 = a | c;
983 const uint_fast32_t t1 = b ^ c;
984 const uint_fast32_t t2 = t0 & t1;
985 return t2;
986 }
987
988 SIMDE_FUNCTION_ATTRIBUTES
989 uint_fast32_t
990 simde_x_ternarylogic_0x63_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
991 const uint_fast32_t t0 = ~a;
992 const uint_fast32_t t1 = t0 | c;
993 const uint_fast32_t t2 = b ^ t1;
994 return t2;
995 }
996
997 SIMDE_FUNCTION_ATTRIBUTES
998 uint_fast32_t
999 simde_x_ternarylogic_0x64_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1000 const uint_fast32_t t0 = a | b;
1001 const uint_fast32_t t1 = b ^ c;
1002 const uint_fast32_t t2 = t0 & t1;
1003 return t2;
1004 }
1005
1006 SIMDE_FUNCTION_ATTRIBUTES
1007 uint_fast32_t
1008 simde_x_ternarylogic_0x65_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1009 const uint_fast32_t t0 = ~a;
1010 const uint_fast32_t t1 = t0 | b;
1011 const uint_fast32_t t2 = c ^ t1;
1012 return t2;
1013 }
1014
1015 SIMDE_FUNCTION_ATTRIBUTES
1016 uint_fast32_t
1017 simde_x_ternarylogic_0x66_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1018 HEDLEY_STATIC_CAST(void, a);
1019 const uint_fast32_t t0 = c ^ b;
1020 return t0;
1021 }
1022
1023 SIMDE_FUNCTION_ATTRIBUTES
1024 uint_fast32_t
1025 simde_x_ternarylogic_0x67_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1026 const uint_fast32_t t0 = b ^ c;
1027 const uint_fast32_t t1 = a | b;
1028 const uint_fast32_t t2 = ~t1;
1029 const uint_fast32_t t3 = t0 | t2;
1030 return t3;
1031 }
1032
1033 SIMDE_FUNCTION_ATTRIBUTES
1034 uint_fast32_t
1035 simde_x_ternarylogic_0x68_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1036 const uint_fast32_t t0 = b ^ c;
1037 const uint_fast32_t t1 = a & t0;
1038 const uint_fast32_t t2 = ~a;
1039 const uint_fast32_t t3 = b & c;
1040 const uint_fast32_t t4 = t2 & t3;
1041 const uint_fast32_t t5 = t1 | t4;
1042 return t5;
1043 }
1044
1045 SIMDE_FUNCTION_ATTRIBUTES
1046 uint_fast32_t
1047 simde_x_ternarylogic_0x69_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1048 const uint_fast32_t t0 = b ^ c;
1049 const uint_fast32_t t1 = a ^ t0;
1050 const uint_fast32_t t2 = ~t1;
1051 return t2;
1052 }
1053
1054 SIMDE_FUNCTION_ATTRIBUTES
1055 uint_fast32_t
1056 simde_x_ternarylogic_0x6a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1057 const uint_fast32_t t0 = b & a;
1058 const uint_fast32_t t1 = c ^ t0;
1059 return t1;
1060 }
1061
1062 SIMDE_FUNCTION_ATTRIBUTES
1063 uint_fast32_t
1064 simde_x_ternarylogic_0x6b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1065 const uint_fast32_t t0 = ~a;
1066 const uint_fast32_t t1 = t0 & c;
1067 const uint_fast32_t c1 = ~HEDLEY_STATIC_CAST(uint_fast32_t, 0);
1068 const uint_fast32_t t2 = a ^ c1;
1069 const uint_fast32_t t3 = b ^ c;
1070 const uint_fast32_t t4 = t2 ^ t3;
1071 const uint_fast32_t t5 = t1 | t4;
1072 return t5;
1073 }
1074
1075 SIMDE_FUNCTION_ATTRIBUTES
1076 uint_fast32_t
1077 simde_x_ternarylogic_0x6c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1078 const uint_fast32_t t0 = a & c;
1079 const uint_fast32_t t1 = b ^ t0;
1080 return t1;
1081 }
1082
1083 SIMDE_FUNCTION_ATTRIBUTES
1084 uint_fast32_t
1085 simde_x_ternarylogic_0x6d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1086 const uint_fast32_t t0 = ~a;
1087 const uint_fast32_t t1 = t0 & b;
1088 const uint_fast32_t c1 = ~HEDLEY_STATIC_CAST(uint_fast32_t, 0);
1089 const uint_fast32_t t2 = a ^ c1;
1090 const uint_fast32_t t3 = b ^ c;
1091 const uint_fast32_t t4 = t2 ^ t3;
1092 const uint_fast32_t t5 = t1 | t4;
1093 return t5;
1094 }
1095
1096 SIMDE_FUNCTION_ATTRIBUTES
1097 uint_fast32_t
1098 simde_x_ternarylogic_0x6e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1099 const uint_fast32_t t0 = ~a;
1100 const uint_fast32_t t1 = t0 & b;
1101 const uint_fast32_t t2 = b ^ c;
1102 const uint_fast32_t t3 = t1 | t2;
1103 return t3;
1104 }
1105
1106 SIMDE_FUNCTION_ATTRIBUTES
1107 uint_fast32_t
1108 simde_x_ternarylogic_0x6f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1109 const uint_fast32_t t0 = ~a;
1110 const uint_fast32_t t1 = b ^ c;
1111 const uint_fast32_t t2 = t0 | t1;
1112 return t2;
1113 }
1114
1115 SIMDE_FUNCTION_ATTRIBUTES
1116 uint_fast32_t
1117 simde_x_ternarylogic_0x70_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1118 const uint_fast32_t t0 = b & c;
1119 const uint_fast32_t t1 = ~t0;
1120 const uint_fast32_t t2 = a & t1;
1121 return t2;
1122 }
1123
1124 SIMDE_FUNCTION_ATTRIBUTES
1125 uint_fast32_t
1126 simde_x_ternarylogic_0x71_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1127 const uint_fast32_t t0 = b | c;
1128 const uint_fast32_t t1 = ~t0;
1129 const uint_fast32_t t2 = b ^ c;
1130 const uint_fast32_t t3 = a & t2;
1131 const uint_fast32_t t4 = t1 | t3;
1132 return t4;
1133 }
1134
1135 SIMDE_FUNCTION_ATTRIBUTES
1136 uint_fast32_t
1137 simde_x_ternarylogic_0x72_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1138 const uint_fast32_t t0 = ~b;
1139 const uint_fast32_t t1 = c & t0;
1140 const uint_fast32_t t2 = ~c;
1141 const uint_fast32_t t3 = t2 & a;
1142 const uint_fast32_t t4 = t1 | t3;
1143 return t4;
1144 }
1145
1146 SIMDE_FUNCTION_ATTRIBUTES
1147 uint_fast32_t
1148 simde_x_ternarylogic_0x73_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1149 const uint_fast32_t t0 = ~b;
1150 const uint_fast32_t t1 = ~c;
1151 const uint_fast32_t t2 = a & t1;
1152 const uint_fast32_t t3 = t0 | t2;
1153 return t3;
1154 }
1155
1156 SIMDE_FUNCTION_ATTRIBUTES
1157 uint_fast32_t
1158 simde_x_ternarylogic_0x74_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1159 const uint_fast32_t t0 = ~c;
1160 const uint_fast32_t t1 = b & t0;
1161 const uint_fast32_t t2 = ~b;
1162 const uint_fast32_t t3 = t2 & a;
1163 const uint_fast32_t t4 = t1 | t3;
1164 return t4;
1165 }
1166
1167 SIMDE_FUNCTION_ATTRIBUTES
1168 uint_fast32_t
1169 simde_x_ternarylogic_0x75_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1170 const uint_fast32_t t0 = ~c;
1171 const uint_fast32_t t1 = ~b;
1172 const uint_fast32_t t2 = a & t1;
1173 const uint_fast32_t t3 = t0 | t2;
1174 return t3;
1175 }
1176
1177 SIMDE_FUNCTION_ATTRIBUTES
1178 uint_fast32_t
1179 simde_x_ternarylogic_0x76_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1180 const uint_fast32_t t0 = ~b;
1181 const uint_fast32_t t1 = t0 & a;
1182 const uint_fast32_t t2 = b ^ c;
1183 const uint_fast32_t t3 = t1 | t2;
1184 return t3;
1185 }
1186
1187 SIMDE_FUNCTION_ATTRIBUTES
1188 uint_fast32_t
1189 simde_x_ternarylogic_0x77_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1190 HEDLEY_STATIC_CAST(void, a);
1191 const uint_fast32_t t0 = c & b;
1192 const uint_fast32_t t1 = ~t0;
1193 return t1;
1194 }
1195
1196 SIMDE_FUNCTION_ATTRIBUTES
1197 uint_fast32_t
1198 simde_x_ternarylogic_0x78_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1199 const uint_fast32_t t0 = b & c;
1200 const uint_fast32_t t1 = a ^ t0;
1201 return t1;
1202 }
1203
1204 SIMDE_FUNCTION_ATTRIBUTES
1205 uint_fast32_t
1206 simde_x_ternarylogic_0x79_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1207 const uint_fast32_t t0 = ~b;
1208 const uint_fast32_t t1 = t0 & a;
1209 const uint_fast32_t c1 = ~HEDLEY_STATIC_CAST(uint_fast32_t, 0);
1210 const uint_fast32_t t2 = b ^ c1;
1211 const uint_fast32_t t3 = a ^ c;
1212 const uint_fast32_t t4 = t2 ^ t3;
1213 const uint_fast32_t t5 = t1 | t4;
1214 return t5;
1215 }
1216
1217 SIMDE_FUNCTION_ATTRIBUTES
1218 uint_fast32_t
1219 simde_x_ternarylogic_0x7a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1220 const uint_fast32_t t0 = ~b;
1221 const uint_fast32_t t1 = t0 & a;
1222 const uint_fast32_t t2 = a ^ c;
1223 const uint_fast32_t t3 = t1 | t2;
1224 return t3;
1225 }
1226
1227 SIMDE_FUNCTION_ATTRIBUTES
1228 uint_fast32_t
1229 simde_x_ternarylogic_0x7b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1230 const uint_fast32_t t0 = ~b;
1231 const uint_fast32_t t1 = a ^ c;
1232 const uint_fast32_t t2 = t0 | t1;
1233 return t2;
1234 }
1235
1236 SIMDE_FUNCTION_ATTRIBUTES
1237 uint_fast32_t
1238 simde_x_ternarylogic_0x7c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1239 const uint_fast32_t t0 = ~c;
1240 const uint_fast32_t t1 = t0 & a;
1241 const uint_fast32_t t2 = a ^ b;
1242 const uint_fast32_t t3 = t1 | t2;
1243 return t3;
1244 }
1245
1246 SIMDE_FUNCTION_ATTRIBUTES
1247 uint_fast32_t
1248 simde_x_ternarylogic_0x7d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1249 const uint_fast32_t t0 = ~c;
1250 const uint_fast32_t t1 = a ^ b;
1251 const uint_fast32_t t2 = t0 | t1;
1252 return t2;
1253 }
1254
1255 SIMDE_FUNCTION_ATTRIBUTES
1256 uint_fast32_t
1257 simde_x_ternarylogic_0x7e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1258 const uint_fast32_t t0 = a ^ b;
1259 const uint_fast32_t t1 = a ^ c;
1260 const uint_fast32_t t2 = t0 | t1;
1261 return t2;
1262 }
1263
1264 SIMDE_FUNCTION_ATTRIBUTES
1265 uint_fast32_t
1266 simde_x_ternarylogic_0x7f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1267 const uint_fast32_t t0 = a & b;
1268 const uint_fast32_t t1 = t0 & c;
1269 const uint_fast32_t c1 = ~HEDLEY_STATIC_CAST(uint_fast32_t, 0);
1270 const uint_fast32_t t2 = t1 ^ c1;
1271 return t2;
1272 }
1273
1274 SIMDE_FUNCTION_ATTRIBUTES
1275 uint_fast32_t
1276 simde_x_ternarylogic_0x80_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1277 const uint_fast32_t t0 = b & c;
1278 const uint_fast32_t t1 = a & t0;
1279 return t1;
1280 }
1281
1282 SIMDE_FUNCTION_ATTRIBUTES
1283 uint_fast32_t
1284 simde_x_ternarylogic_0x81_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1285 const uint_fast32_t t0 = a ^ c;
1286 const uint_fast32_t t1 = ~t0;
1287 const uint_fast32_t t2 = ~b;
1288 const uint_fast32_t t3 = a ^ t2;
1289 const uint_fast32_t t4 = t1 & t3;
1290 return t4;
1291 }
1292
1293 SIMDE_FUNCTION_ATTRIBUTES
1294 uint_fast32_t
1295 simde_x_ternarylogic_0x82_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1296 const uint_fast32_t t0 = b ^ a;
1297 const uint_fast32_t t1 = ~t0;
1298 const uint_fast32_t t2 = c & t1;
1299 return t2;
1300 }
1301
1302 SIMDE_FUNCTION_ATTRIBUTES
1303 uint_fast32_t
1304 simde_x_ternarylogic_0x83_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1305 const uint_fast32_t t0 = a ^ b;
1306 const uint_fast32_t t1 = ~t0;
1307 const uint_fast32_t t2 = ~a;
1308 const uint_fast32_t t3 = t2 | c;
1309 const uint_fast32_t t4 = t1 & t3;
1310 return t4;
1311 }
1312
1313 SIMDE_FUNCTION_ATTRIBUTES
1314 uint_fast32_t
1315 simde_x_ternarylogic_0x84_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1316 const uint_fast32_t t0 = a ^ c;
1317 const uint_fast32_t t1 = ~t0;
1318 const uint_fast32_t t2 = b & t1;
1319 return t2;
1320 }
1321
1322 SIMDE_FUNCTION_ATTRIBUTES
1323 uint_fast32_t
1324 simde_x_ternarylogic_0x85_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1325 const uint_fast32_t t0 = a ^ c;
1326 const uint_fast32_t t1 = ~t0;
1327 const uint_fast32_t t2 = ~c;
1328 const uint_fast32_t t3 = t2 | b;
1329 const uint_fast32_t t4 = t1 & t3;
1330 return t4;
1331 }
1332
1333 SIMDE_FUNCTION_ATTRIBUTES
1334 uint_fast32_t
1335 simde_x_ternarylogic_0x86_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1336 const uint_fast32_t t0 = b | c;
1337 const uint_fast32_t t1 = a ^ b;
1338 const uint_fast32_t t2 = c ^ t1;
1339 const uint_fast32_t t3 = t0 & t2;
1340 return t3;
1341 }
1342
1343 SIMDE_FUNCTION_ATTRIBUTES
1344 uint_fast32_t
1345 simde_x_ternarylogic_0x87_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1346 const uint_fast32_t t0 = b & c;
1347 const uint_fast32_t t1 = a ^ t0;
1348 const uint_fast32_t t2 = ~t1;
1349 return t2;
1350 }
1351
1352 SIMDE_FUNCTION_ATTRIBUTES
1353 uint_fast32_t
1354 simde_x_ternarylogic_0x88_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1355 HEDLEY_STATIC_CAST(void, a);
1356 const uint_fast32_t t0 = c & b;
1357 return t0;
1358 }
1359
1360 SIMDE_FUNCTION_ATTRIBUTES
1361 uint_fast32_t
1362 simde_x_ternarylogic_0x89_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1363 const uint_fast32_t t0 = b ^ c;
1364 const uint_fast32_t t1 = ~t0;
1365 const uint_fast32_t t2 = ~a;
1366 const uint_fast32_t t3 = t2 | b;
1367 const uint_fast32_t t4 = t1 & t3;
1368 return t4;
1369 }
1370
1371 SIMDE_FUNCTION_ATTRIBUTES
1372 uint_fast32_t
1373 simde_x_ternarylogic_0x8a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1374 const uint_fast32_t t0 = ~a;
1375 const uint_fast32_t t1 = t0 | b;
1376 const uint_fast32_t t2 = c & t1;
1377 return t2;
1378 }
1379
1380 SIMDE_FUNCTION_ATTRIBUTES
1381 uint_fast32_t
1382 simde_x_ternarylogic_0x8b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1383 const uint_fast32_t t0 = ~a;
1384 const uint_fast32_t t1 = t0 | b;
1385 const uint_fast32_t t2 = ~b;
1386 const uint_fast32_t t3 = t2 | c;
1387 const uint_fast32_t t4 = t1 & t3;
1388 return t4;
1389 }
1390
1391 SIMDE_FUNCTION_ATTRIBUTES
1392 uint_fast32_t
1393 simde_x_ternarylogic_0x8c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1394 const uint_fast32_t t0 = ~a;
1395 const uint_fast32_t t1 = t0 | c;
1396 const uint_fast32_t t2 = b & t1;
1397 return t2;
1398 }
1399
1400 SIMDE_FUNCTION_ATTRIBUTES
1401 uint_fast32_t
1402 simde_x_ternarylogic_0x8d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1403 const uint_fast32_t t0 = ~c;
1404 const uint_fast32_t t1 = t0 | b;
1405 const uint_fast32_t t2 = ~a;
1406 const uint_fast32_t t3 = t2 | c;
1407 const uint_fast32_t t4 = t1 & t3;
1408 return t4;
1409 }
1410
1411 SIMDE_FUNCTION_ATTRIBUTES
1412 uint_fast32_t
1413 simde_x_ternarylogic_0x8e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1414 const uint_fast32_t t0 = b & c;
1415 const uint_fast32_t t1 = ~a;
1416 const uint_fast32_t t2 = b ^ c;
1417 const uint_fast32_t t3 = t1 & t2;
1418 const uint_fast32_t t4 = t0 | t3;
1419 return t4;
1420 }
1421
1422 SIMDE_FUNCTION_ATTRIBUTES
1423 uint_fast32_t
1424 simde_x_ternarylogic_0x8f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1425 const uint_fast32_t t0 = ~a;
1426 const uint_fast32_t t1 = b & c;
1427 const uint_fast32_t t2 = t0 | t1;
1428 return t2;
1429 }
1430
1431 SIMDE_FUNCTION_ATTRIBUTES
1432 uint_fast32_t
1433 simde_x_ternarylogic_0x90_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1434 const uint_fast32_t t0 = b ^ c;
1435 const uint_fast32_t t1 = ~t0;
1436 const uint_fast32_t t2 = a & t1;
1437 return t2;
1438 }
1439
1440 SIMDE_FUNCTION_ATTRIBUTES
1441 uint_fast32_t
1442 simde_x_ternarylogic_0x91_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1443 const uint_fast32_t t0 = b ^ c;
1444 const uint_fast32_t t1 = ~t0;
1445 const uint_fast32_t t2 = ~b;
1446 const uint_fast32_t t3 = t2 | a;
1447 const uint_fast32_t t4 = t1 & t3;
1448 return t4;
1449 }
1450
1451 SIMDE_FUNCTION_ATTRIBUTES
1452 uint_fast32_t
1453 simde_x_ternarylogic_0x92_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1454 const uint_fast32_t t0 = a | c;
1455 const uint_fast32_t t1 = a ^ b;
1456 const uint_fast32_t t2 = c ^ t1;
1457 const uint_fast32_t t3 = t0 & t2;
1458 return t3;
1459 }
1460
1461 SIMDE_FUNCTION_ATTRIBUTES
1462 uint_fast32_t
1463 simde_x_ternarylogic_0x93_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1464 const uint_fast32_t t0 = a & c;
1465 const uint_fast32_t t1 = b ^ t0;
1466 const uint_fast32_t t2 = ~t1;
1467 return t2;
1468 }
1469
1470 SIMDE_FUNCTION_ATTRIBUTES
1471 uint_fast32_t
1472 simde_x_ternarylogic_0x94_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1473 const uint_fast32_t t0 = a | b;
1474 const uint_fast32_t t1 = a ^ c;
1475 const uint_fast32_t t2 = b ^ t1;
1476 const uint_fast32_t t3 = t0 & t2;
1477 return t3;
1478 }
1479
1480 SIMDE_FUNCTION_ATTRIBUTES
1481 uint_fast32_t
1482 simde_x_ternarylogic_0x95_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1483 const uint_fast32_t t0 = b & a;
1484 const uint_fast32_t t1 = c ^ t0;
1485 const uint_fast32_t t2 = ~t1;
1486 return t2;
1487 }
1488
1489 SIMDE_FUNCTION_ATTRIBUTES
1490 uint_fast32_t
1491 simde_x_ternarylogic_0x96_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1492 const uint_fast32_t t0 = b ^ c;
1493 const uint_fast32_t t1 = a ^ t0;
1494 return t1;
1495 }
1496
1497 SIMDE_FUNCTION_ATTRIBUTES
1498 uint_fast32_t
1499 simde_x_ternarylogic_0x97_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1500 const uint_fast32_t t0 = ~b;
1501 const uint_fast32_t t1 = t0 | a;
1502 const uint_fast32_t t2 = t1 ^ a;
1503 const uint_fast32_t t3 = b ^ c;
1504 const uint_fast32_t t4 = a ^ t3;
1505 const uint_fast32_t t5 = t2 | t4;
1506 return t5;
1507 }
1508
1509 SIMDE_FUNCTION_ATTRIBUTES
1510 uint_fast32_t
1511 simde_x_ternarylogic_0x98_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1512 const uint_fast32_t t0 = b ^ c;
1513 const uint_fast32_t t1 = ~t0;
1514 const uint_fast32_t t2 = a | b;
1515 const uint_fast32_t t3 = t1 & t2;
1516 return t3;
1517 }
1518
1519 SIMDE_FUNCTION_ATTRIBUTES
1520 uint_fast32_t
1521 simde_x_ternarylogic_0x99_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1522 HEDLEY_STATIC_CAST(void, a);
1523 const uint_fast32_t t0 = c ^ b;
1524 const uint_fast32_t t1 = ~t0;
1525 return t1;
1526 }
1527
1528 SIMDE_FUNCTION_ATTRIBUTES
1529 uint_fast32_t
1530 simde_x_ternarylogic_0x9a_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1531 const uint_fast32_t t0 = ~b;
1532 const uint_fast32_t t1 = t0 & a;
1533 const uint_fast32_t t2 = t1 ^ c;
1534 return t2;
1535 }
1536
1537 SIMDE_FUNCTION_ATTRIBUTES
1538 uint_fast32_t
1539 simde_x_ternarylogic_0x9b_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1540 const uint_fast32_t t0 = b ^ c;
1541 const uint_fast32_t t1 = ~t0;
1542 const uint_fast32_t t2 = ~a;
1543 const uint_fast32_t t3 = t2 & c;
1544 const uint_fast32_t t4 = t1 | t3;
1545 return t4;
1546 }
1547
1548 SIMDE_FUNCTION_ATTRIBUTES
1549 uint_fast32_t
1550 simde_x_ternarylogic_0x9c_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1551 const uint_fast32_t t0 = ~c;
1552 const uint_fast32_t t1 = t0 & a;
1553 const uint_fast32_t t2 = t1 ^ b;
1554 return t2;
1555 }
1556
1557 SIMDE_FUNCTION_ATTRIBUTES
1558 uint_fast32_t
1559 simde_x_ternarylogic_0x9d_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1560 const uint_fast32_t t0 = b ^ c;
1561 const uint_fast32_t t1 = ~t0;
1562 const uint_fast32_t t2 = ~a;
1563 const uint_fast32_t t3 = t2 & b;
1564 const uint_fast32_t t4 = t1 | t3;
1565 return t4;
1566 }
1567
1568 SIMDE_FUNCTION_ATTRIBUTES
1569 uint_fast32_t
1570 simde_x_ternarylogic_0x9e_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1571 const uint_fast32_t t0 = b & c;
1572 const uint_fast32_t t1 = a ^ b;
1573 const uint_fast32_t t2 = c ^ t1;
1574 const uint_fast32_t t3 = t0 | t2;
1575 return t3;
1576 }
1577
1578 SIMDE_FUNCTION_ATTRIBUTES
1579 uint_fast32_t
1580 simde_x_ternarylogic_0x9f_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1581 const uint_fast32_t t0 = b ^ c;
1582 const uint_fast32_t t1 = a & t0;
1583 const uint_fast32_t t2 = ~t1;
1584 return t2;
1585 }
1586
1587 SIMDE_FUNCTION_ATTRIBUTES
1588 uint_fast32_t
1589 simde_x_ternarylogic_0xa0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1590 HEDLEY_STATIC_CAST(void, b);
1591 const uint_fast32_t t0 = c & a;
1592 return t0;
1593 }
1594
1595 SIMDE_FUNCTION_ATTRIBUTES
1596 uint_fast32_t
1597 simde_x_ternarylogic_0xa1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1598 const uint_fast32_t t0 = a ^ c;
1599 const uint_fast32_t t1 = ~t0;
1600 const uint_fast32_t t2 = ~b;
1601 const uint_fast32_t t3 = t2 | a;
1602 const uint_fast32_t t4 = t1 & t3;
1603 return t4;
1604 }
1605
1606 SIMDE_FUNCTION_ATTRIBUTES
1607 uint_fast32_t
1608 simde_x_ternarylogic_0xa2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1609 const uint_fast32_t t0 = ~b;
1610 const uint_fast32_t t1 = a | t0;
1611 const uint_fast32_t t2 = c & t1;
1612 return t2;
1613 }
1614
1615 SIMDE_FUNCTION_ATTRIBUTES
1616 uint_fast32_t
1617 simde_x_ternarylogic_0xa3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1618 const uint_fast32_t t0 = ~b;
1619 const uint_fast32_t t1 = t0 | a;
1620 const uint_fast32_t t2 = ~a;
1621 const uint_fast32_t t3 = t2 | c;
1622 const uint_fast32_t t4 = t1 & t3;
1623 return t4;
1624 }
1625
1626 SIMDE_FUNCTION_ATTRIBUTES
1627 uint_fast32_t
1628 simde_x_ternarylogic_0xa4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1629 const uint_fast32_t t0 = a ^ c;
1630 const uint_fast32_t t1 = ~t0;
1631 const uint_fast32_t t2 = a | b;
1632 const uint_fast32_t t3 = t1 & t2;
1633 return t3;
1634 }
1635
1636 SIMDE_FUNCTION_ATTRIBUTES
1637 uint_fast32_t
1638 simde_x_ternarylogic_0xa5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1639 HEDLEY_STATIC_CAST(void, b);
1640 const uint_fast32_t t0 = c ^ a;
1641 const uint_fast32_t t1 = ~t0;
1642 return t1;
1643 }
1644
1645 SIMDE_FUNCTION_ATTRIBUTES
1646 uint_fast32_t
1647 simde_x_ternarylogic_0xa6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1648 const uint_fast32_t t0 = ~a;
1649 const uint_fast32_t t1 = t0 & b;
1650 const uint_fast32_t t2 = t1 ^ c;
1651 return t2;
1652 }
1653
1654 SIMDE_FUNCTION_ATTRIBUTES
1655 uint_fast32_t
1656 simde_x_ternarylogic_0xa7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1657 const uint_fast32_t t0 = a ^ c;
1658 const uint_fast32_t t1 = ~t0;
1659 const uint_fast32_t t2 = ~b;
1660 const uint_fast32_t t3 = t2 & c;
1661 const uint_fast32_t t4 = t1 | t3;
1662 return t4;
1663 }
1664
1665 SIMDE_FUNCTION_ATTRIBUTES
1666 uint_fast32_t
1667 simde_x_ternarylogic_0xa8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1668 const uint_fast32_t t0 = a | b;
1669 const uint_fast32_t t1 = c & t0;
1670 return t1;
1671 }
1672
1673 SIMDE_FUNCTION_ATTRIBUTES
1674 uint_fast32_t
1675 simde_x_ternarylogic_0xa9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1676 const uint_fast32_t t0 = b | a;
1677 const uint_fast32_t t1 = c ^ t0;
1678 const uint_fast32_t t2 = ~t1;
1679 return t2;
1680 }
1681
1682 SIMDE_FUNCTION_ATTRIBUTES
1683 uint_fast32_t
1684 simde_x_ternarylogic_0xaa_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1685 HEDLEY_STATIC_CAST(void, a);
1686 HEDLEY_STATIC_CAST(void, b);
1687 return c;
1688 }
1689
1690 SIMDE_FUNCTION_ATTRIBUTES
1691 uint_fast32_t
1692 simde_x_ternarylogic_0xab_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1693 const uint_fast32_t t0 = b | a;
1694 const uint_fast32_t t1 = ~t0;
1695 const uint_fast32_t t2 = c | t1;
1696 return t2;
1697 }
1698
1699 SIMDE_FUNCTION_ATTRIBUTES
1700 uint_fast32_t
1701 simde_x_ternarylogic_0xac_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1702 const uint_fast32_t t0 = a & c;
1703 const uint_fast32_t t1 = ~a;
1704 const uint_fast32_t t2 = t1 & b;
1705 const uint_fast32_t t3 = t0 | t2;
1706 return t3;
1707 }
1708
1709 SIMDE_FUNCTION_ATTRIBUTES
1710 uint_fast32_t
1711 simde_x_ternarylogic_0xad_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1712 const uint_fast32_t t0 = a ^ c;
1713 const uint_fast32_t t1 = ~t0;
1714 const uint_fast32_t t2 = b & c;
1715 const uint_fast32_t t3 = t1 | t2;
1716 return t3;
1717 }
1718
1719 SIMDE_FUNCTION_ATTRIBUTES
1720 uint_fast32_t
1721 simde_x_ternarylogic_0xae_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1722 const uint_fast32_t t0 = ~a;
1723 const uint_fast32_t t1 = t0 & b;
1724 const uint_fast32_t t2 = t1 | c;
1725 return t2;
1726 }
1727
1728 SIMDE_FUNCTION_ATTRIBUTES
1729 uint_fast32_t
1730 simde_x_ternarylogic_0xaf_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1731 HEDLEY_STATIC_CAST(void, b);
1732 const uint_fast32_t t0 = ~a;
1733 const uint_fast32_t t1 = c | t0;
1734 return t1;
1735 }
1736
1737 SIMDE_FUNCTION_ATTRIBUTES
1738 uint_fast32_t
1739 simde_x_ternarylogic_0xb0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1740 const uint_fast32_t t0 = ~b;
1741 const uint_fast32_t t1 = t0 | c;
1742 const uint_fast32_t t2 = a & t1;
1743 return t2;
1744 }
1745
1746 SIMDE_FUNCTION_ATTRIBUTES
1747 uint_fast32_t
1748 simde_x_ternarylogic_0xb1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1749 const uint_fast32_t t0 = ~c;
1750 const uint_fast32_t t1 = t0 | a;
1751 const uint_fast32_t t2 = ~b;
1752 const uint_fast32_t t3 = t2 | c;
1753 const uint_fast32_t t4 = t1 & t3;
1754 return t4;
1755 }
1756
1757 SIMDE_FUNCTION_ATTRIBUTES
1758 uint_fast32_t
1759 simde_x_ternarylogic_0xb2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1760 const uint_fast32_t t0 = a & c;
1761 const uint_fast32_t t1 = b & t0;
1762 const uint_fast32_t t2 = ~b;
1763 const uint_fast32_t t3 = a | c;
1764 const uint_fast32_t t4 = t2 & t3;
1765 const uint_fast32_t t5 = t1 | t4;
1766 return t5;
1767 }
1768
1769 SIMDE_FUNCTION_ATTRIBUTES
1770 uint_fast32_t
1771 simde_x_ternarylogic_0xb3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1772 const uint_fast32_t t0 = ~b;
1773 const uint_fast32_t t1 = a & c;
1774 const uint_fast32_t t2 = t0 | t1;
1775 return t2;
1776 }
1777
1778 SIMDE_FUNCTION_ATTRIBUTES
1779 uint_fast32_t
1780 simde_x_ternarylogic_0xb4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1781 const uint_fast32_t t0 = ~c;
1782 const uint_fast32_t t1 = t0 & b;
1783 const uint_fast32_t t2 = t1 ^ a;
1784 return t2;
1785 }
1786
1787 SIMDE_FUNCTION_ATTRIBUTES
1788 uint_fast32_t
1789 simde_x_ternarylogic_0xb5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1790 const uint_fast32_t t0 = a ^ c;
1791 const uint_fast32_t t1 = ~t0;
1792 const uint_fast32_t t2 = ~b;
1793 const uint_fast32_t t3 = t2 & a;
1794 const uint_fast32_t t4 = t1 | t3;
1795 return t4;
1796 }
1797
1798 SIMDE_FUNCTION_ATTRIBUTES
1799 uint_fast32_t
1800 simde_x_ternarylogic_0xb6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1801 const uint_fast32_t t0 = a & c;
1802 const uint_fast32_t t1 = a ^ b;
1803 const uint_fast32_t t2 = c ^ t1;
1804 const uint_fast32_t t3 = t0 | t2;
1805 return t3;
1806 }
1807
1808 SIMDE_FUNCTION_ATTRIBUTES
1809 uint_fast32_t
1810 simde_x_ternarylogic_0xb7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1811 const uint_fast32_t t0 = a ^ c;
1812 const uint_fast32_t t1 = b & t0;
1813 const uint_fast32_t t2 = ~t1;
1814 return t2;
1815 }
1816
1817 SIMDE_FUNCTION_ATTRIBUTES
1818 uint_fast32_t
1819 simde_x_ternarylogic_0xb8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1820 const uint_fast32_t t0 = b & c;
1821 const uint_fast32_t t1 = ~b;
1822 const uint_fast32_t t2 = t1 & a;
1823 const uint_fast32_t t3 = t0 | t2;
1824 return t3;
1825 }
1826
1827 SIMDE_FUNCTION_ATTRIBUTES
1828 uint_fast32_t
1829 simde_x_ternarylogic_0xb9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1830 const uint_fast32_t t0 = b ^ c;
1831 const uint_fast32_t t1 = ~t0;
1832 const uint_fast32_t t2 = a & c;
1833 const uint_fast32_t t3 = t1 | t2;
1834 return t3;
1835 }
1836
1837 SIMDE_FUNCTION_ATTRIBUTES
1838 uint_fast32_t
1839 simde_x_ternarylogic_0xba_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1840 const uint_fast32_t t0 = ~b;
1841 const uint_fast32_t t1 = t0 & a;
1842 const uint_fast32_t t2 = t1 | c;
1843 return t2;
1844 }
1845
1846 SIMDE_FUNCTION_ATTRIBUTES
1847 uint_fast32_t
1848 simde_x_ternarylogic_0xbb_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1849 HEDLEY_STATIC_CAST(void, a);
1850 const uint_fast32_t t0 = ~b;
1851 const uint_fast32_t t1 = c | t0;
1852 return t1;
1853 }
1854
1855 SIMDE_FUNCTION_ATTRIBUTES
1856 uint_fast32_t
1857 simde_x_ternarylogic_0xbc_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1858 const uint_fast32_t t0 = a & c;
1859 const uint_fast32_t t1 = a ^ b;
1860 const uint_fast32_t t2 = t0 | t1;
1861 return t2;
1862 }
1863
1864 SIMDE_FUNCTION_ATTRIBUTES
1865 uint_fast32_t
1866 simde_x_ternarylogic_0xbd_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1867 const uint_fast32_t t0 = a ^ c;
1868 const uint_fast32_t t1 = ~t0;
1869 const uint_fast32_t t2 = a ^ b;
1870 const uint_fast32_t t3 = t1 | t2;
1871 return t3;
1872 }
1873
1874 SIMDE_FUNCTION_ATTRIBUTES
1875 uint_fast32_t
1876 simde_x_ternarylogic_0xbe_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1877 const uint_fast32_t t0 = b ^ a;
1878 const uint_fast32_t t1 = c | t0;
1879 return t1;
1880 }
1881
1882 SIMDE_FUNCTION_ATTRIBUTES
1883 uint_fast32_t
1884 simde_x_ternarylogic_0xbf_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1885 const uint_fast32_t t0 = b & a;
1886 const uint_fast32_t t1 = ~t0;
1887 const uint_fast32_t t2 = c | t1;
1888 return t2;
1889 }
1890
1891 SIMDE_FUNCTION_ATTRIBUTES
1892 uint_fast32_t
1893 simde_x_ternarylogic_0xc0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1894 HEDLEY_STATIC_CAST(void, c);
1895 const uint_fast32_t t0 = b & a;
1896 return t0;
1897 }
1898
1899 SIMDE_FUNCTION_ATTRIBUTES
1900 uint_fast32_t
1901 simde_x_ternarylogic_0xc1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1902 const uint_fast32_t t0 = a ^ b;
1903 const uint_fast32_t t1 = ~t0;
1904 const uint_fast32_t t2 = ~c;
1905 const uint_fast32_t t3 = t2 | a;
1906 const uint_fast32_t t4 = t1 & t3;
1907 return t4;
1908 }
1909
1910 SIMDE_FUNCTION_ATTRIBUTES
1911 uint_fast32_t
1912 simde_x_ternarylogic_0xc2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1913 const uint_fast32_t t0 = a ^ b;
1914 const uint_fast32_t t1 = ~t0;
1915 const uint_fast32_t t2 = a | c;
1916 const uint_fast32_t t3 = t1 & t2;
1917 return t3;
1918 }
1919
1920 SIMDE_FUNCTION_ATTRIBUTES
1921 uint_fast32_t
1922 simde_x_ternarylogic_0xc3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1923 HEDLEY_STATIC_CAST(void, c);
1924 const uint_fast32_t t0 = b ^ a;
1925 const uint_fast32_t t1 = ~t0;
1926 return t1;
1927 }
1928
1929 SIMDE_FUNCTION_ATTRIBUTES
1930 uint_fast32_t
1931 simde_x_ternarylogic_0xc4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1932 const uint_fast32_t t0 = ~c;
1933 const uint_fast32_t t1 = t0 | a;
1934 const uint_fast32_t t2 = b & t1;
1935 return t2;
1936 }
1937
1938 SIMDE_FUNCTION_ATTRIBUTES
1939 uint_fast32_t
1940 simde_x_ternarylogic_0xc5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1941 const uint_fast32_t t0 = ~c;
1942 const uint_fast32_t t1 = t0 | a;
1943 const uint_fast32_t t2 = ~a;
1944 const uint_fast32_t t3 = t2 | b;
1945 const uint_fast32_t t4 = t1 & t3;
1946 return t4;
1947 }
1948
1949 SIMDE_FUNCTION_ATTRIBUTES
1950 uint_fast32_t
1951 simde_x_ternarylogic_0xc6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1952 const uint_fast32_t t0 = ~a;
1953 const uint_fast32_t t1 = t0 & c;
1954 const uint_fast32_t t2 = t1 ^ b;
1955 return t2;
1956 }
1957
1958 SIMDE_FUNCTION_ATTRIBUTES
1959 uint_fast32_t
1960 simde_x_ternarylogic_0xc7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1961 const uint_fast32_t t0 = a ^ b;
1962 const uint_fast32_t t1 = ~t0;
1963 const uint_fast32_t t2 = ~c;
1964 const uint_fast32_t t3 = t2 & b;
1965 const uint_fast32_t t4 = t1 | t3;
1966 return t4;
1967 }
1968
1969 SIMDE_FUNCTION_ATTRIBUTES
1970 uint_fast32_t
1971 simde_x_ternarylogic_0xc8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1972 const uint_fast32_t t0 = a | c;
1973 const uint_fast32_t t1 = b & t0;
1974 return t1;
1975 }
1976
1977 SIMDE_FUNCTION_ATTRIBUTES
1978 uint_fast32_t
1979 simde_x_ternarylogic_0xc9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1980 const uint_fast32_t t0 = a | c;
1981 const uint_fast32_t t1 = b ^ t0;
1982 const uint_fast32_t t2 = ~t1;
1983 return t2;
1984 }
1985
1986 SIMDE_FUNCTION_ATTRIBUTES
1987 uint_fast32_t
1988 simde_x_ternarylogic_0xca_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1989 const uint_fast32_t t0 = a & b;
1990 const uint_fast32_t t1 = ~a;
1991 const uint_fast32_t t2 = t1 & c;
1992 const uint_fast32_t t3 = t0 | t2;
1993 return t3;
1994 }
1995
1996 SIMDE_FUNCTION_ATTRIBUTES
1997 uint_fast32_t
1998 simde_x_ternarylogic_0xcb_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
1999 const uint_fast32_t t0 = a ^ b;
2000 const uint_fast32_t t1 = ~t0;
2001 const uint_fast32_t t2 = b & c;
2002 const uint_fast32_t t3 = t1 | t2;
2003 return t3;
2004 }
2005
2006 SIMDE_FUNCTION_ATTRIBUTES
2007 uint_fast32_t
2008 simde_x_ternarylogic_0xcc_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2009 HEDLEY_STATIC_CAST(void, a);
2010 HEDLEY_STATIC_CAST(void, c);
2011 return b;
2012 }
2013
2014 SIMDE_FUNCTION_ATTRIBUTES
2015 uint_fast32_t
2016 simde_x_ternarylogic_0xcd_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2017 const uint_fast32_t t0 = a | c;
2018 const uint_fast32_t t1 = ~t0;
2019 const uint_fast32_t t2 = b | t1;
2020 return t2;
2021 }
2022
2023 SIMDE_FUNCTION_ATTRIBUTES
2024 uint_fast32_t
2025 simde_x_ternarylogic_0xce_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2026 const uint_fast32_t t0 = ~a;
2027 const uint_fast32_t t1 = t0 & c;
2028 const uint_fast32_t t2 = t1 | b;
2029 return t2;
2030 }
2031
2032 SIMDE_FUNCTION_ATTRIBUTES
2033 uint_fast32_t
2034 simde_x_ternarylogic_0xcf_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2035 HEDLEY_STATIC_CAST(void, c);
2036 const uint_fast32_t t0 = ~a;
2037 const uint_fast32_t t1 = b | t0;
2038 return t1;
2039 }
2040
2041 SIMDE_FUNCTION_ATTRIBUTES
2042 uint_fast32_t
2043 simde_x_ternarylogic_0xd0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2044 const uint_fast32_t t0 = ~c;
2045 const uint_fast32_t t1 = b | t0;
2046 const uint_fast32_t t2 = a & t1;
2047 return t2;
2048 }
2049
2050 SIMDE_FUNCTION_ATTRIBUTES
2051 uint_fast32_t
2052 simde_x_ternarylogic_0xd1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2053 const uint_fast32_t t0 = b | c;
2054 const uint_fast32_t t1 = ~t0;
2055 const uint_fast32_t t2 = a & b;
2056 const uint_fast32_t t3 = t1 | t2;
2057 return t3;
2058 }
2059
2060 SIMDE_FUNCTION_ATTRIBUTES
2061 uint_fast32_t
2062 simde_x_ternarylogic_0xd2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2063 const uint_fast32_t t0 = ~b;
2064 const uint_fast32_t t1 = t0 & c;
2065 const uint_fast32_t t2 = t1 ^ a;
2066 return t2;
2067 }
2068
2069 SIMDE_FUNCTION_ATTRIBUTES
2070 uint_fast32_t
2071 simde_x_ternarylogic_0xd3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2072 const uint_fast32_t t0 = a ^ b;
2073 const uint_fast32_t t1 = ~t0;
2074 const uint_fast32_t t2 = ~c;
2075 const uint_fast32_t t3 = t2 & a;
2076 const uint_fast32_t t4 = t1 | t3;
2077 return t4;
2078 }
2079
2080 SIMDE_FUNCTION_ATTRIBUTES
2081 uint_fast32_t
2082 simde_x_ternarylogic_0xd4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2083 const uint_fast32_t t0 = ~c;
2084 const uint_fast32_t t1 = b & t0;
2085 const uint_fast32_t t2 = b ^ c;
2086 const uint_fast32_t t3 = ~t2;
2087 const uint_fast32_t t4 = a & t3;
2088 const uint_fast32_t t5 = t1 | t4;
2089 return t5;
2090 }
2091
2092 SIMDE_FUNCTION_ATTRIBUTES
2093 uint_fast32_t
2094 simde_x_ternarylogic_0xd5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2095 const uint_fast32_t t0 = ~c;
2096 const uint_fast32_t t1 = a & b;
2097 const uint_fast32_t t2 = t0 | t1;
2098 return t2;
2099 }
2100
2101 SIMDE_FUNCTION_ATTRIBUTES
2102 uint_fast32_t
2103 simde_x_ternarylogic_0xd6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2104 const uint_fast32_t t0 = a & b;
2105 const uint_fast32_t t1 = a ^ c;
2106 const uint_fast32_t t2 = b ^ t1;
2107 const uint_fast32_t t3 = t0 | t2;
2108 return t3;
2109 }
2110
2111 SIMDE_FUNCTION_ATTRIBUTES
2112 uint_fast32_t
2113 simde_x_ternarylogic_0xd7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2114 const uint_fast32_t t0 = b ^ a;
2115 const uint_fast32_t t1 = c & t0;
2116 const uint_fast32_t t2 = ~t1;
2117 return t2;
2118 }
2119
2120 SIMDE_FUNCTION_ATTRIBUTES
2121 uint_fast32_t
2122 simde_x_ternarylogic_0xd8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2123 const uint_fast32_t t0 = c & b;
2124 const uint_fast32_t t1 = ~c;
2125 const uint_fast32_t t2 = t1 & a;
2126 const uint_fast32_t t3 = t0 | t2;
2127 return t3;
2128 }
2129
2130 SIMDE_FUNCTION_ATTRIBUTES
2131 uint_fast32_t
2132 simde_x_ternarylogic_0xd9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2133 const uint_fast32_t t0 = b ^ c;
2134 const uint_fast32_t t1 = ~t0;
2135 const uint_fast32_t t2 = a & b;
2136 const uint_fast32_t t3 = t1 | t2;
2137 return t3;
2138 }
2139
2140 SIMDE_FUNCTION_ATTRIBUTES
2141 uint_fast32_t
2142 simde_x_ternarylogic_0xda_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2143 const uint_fast32_t t0 = a & b;
2144 const uint_fast32_t t1 = a ^ c;
2145 const uint_fast32_t t2 = t0 | t1;
2146 return t2;
2147 }
2148
2149 SIMDE_FUNCTION_ATTRIBUTES
2150 uint_fast32_t
2151 simde_x_ternarylogic_0xdb_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2152 const uint_fast32_t t0 = a ^ b;
2153 const uint_fast32_t t1 = ~t0;
2154 const uint_fast32_t t2 = a ^ c;
2155 const uint_fast32_t t3 = t1 | t2;
2156 return t3;
2157 }
2158
2159 SIMDE_FUNCTION_ATTRIBUTES
2160 uint_fast32_t
2161 simde_x_ternarylogic_0xdc_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2162 const uint_fast32_t t0 = ~c;
2163 const uint_fast32_t t1 = t0 & a;
2164 const uint_fast32_t t2 = t1 | b;
2165 return t2;
2166 }
2167
2168 SIMDE_FUNCTION_ATTRIBUTES
2169 uint_fast32_t
2170 simde_x_ternarylogic_0xdd_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2171 HEDLEY_STATIC_CAST(void, a);
2172 const uint_fast32_t t0 = ~c;
2173 const uint_fast32_t t1 = b | t0;
2174 return t1;
2175 }
2176
2177 SIMDE_FUNCTION_ATTRIBUTES
2178 uint_fast32_t
2179 simde_x_ternarylogic_0xde_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2180 const uint_fast32_t t0 = a ^ c;
2181 const uint_fast32_t t1 = b | t0;
2182 return t1;
2183 }
2184
2185 SIMDE_FUNCTION_ATTRIBUTES
2186 uint_fast32_t
2187 simde_x_ternarylogic_0xdf_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2188 const uint_fast32_t t0 = a & c;
2189 const uint_fast32_t t1 = ~t0;
2190 const uint_fast32_t t2 = b | t1;
2191 return t2;
2192 }
2193
2194 SIMDE_FUNCTION_ATTRIBUTES
2195 uint_fast32_t
2196 simde_x_ternarylogic_0xe0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2197 const uint_fast32_t t0 = b | c;
2198 const uint_fast32_t t1 = a & t0;
2199 return t1;
2200 }
2201
2202 SIMDE_FUNCTION_ATTRIBUTES
2203 uint_fast32_t
2204 simde_x_ternarylogic_0xe1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2205 const uint_fast32_t t0 = b | c;
2206 const uint_fast32_t t1 = a ^ t0;
2207 const uint_fast32_t t2 = ~t1;
2208 return t2;
2209 }
2210
2211 SIMDE_FUNCTION_ATTRIBUTES
2212 uint_fast32_t
2213 simde_x_ternarylogic_0xe2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2214 const uint_fast32_t t0 = b & a;
2215 const uint_fast32_t t1 = ~b;
2216 const uint_fast32_t t2 = t1 & c;
2217 const uint_fast32_t t3 = t0 | t2;
2218 return t3;
2219 }
2220
2221 SIMDE_FUNCTION_ATTRIBUTES
2222 uint_fast32_t
2223 simde_x_ternarylogic_0xe3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2224 const uint_fast32_t t0 = a ^ b;
2225 const uint_fast32_t t1 = ~t0;
2226 const uint_fast32_t t2 = a & c;
2227 const uint_fast32_t t3 = t1 | t2;
2228 return t3;
2229 }
2230
2231 SIMDE_FUNCTION_ATTRIBUTES
2232 uint_fast32_t
2233 simde_x_ternarylogic_0xe4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2234 const uint_fast32_t t0 = c & a;
2235 const uint_fast32_t t1 = ~c;
2236 const uint_fast32_t t2 = t1 & b;
2237 const uint_fast32_t t3 = t0 | t2;
2238 return t3;
2239 }
2240
2241 SIMDE_FUNCTION_ATTRIBUTES
2242 uint_fast32_t
2243 simde_x_ternarylogic_0xe5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2244 const uint_fast32_t t0 = a ^ c;
2245 const uint_fast32_t t1 = ~t0;
2246 const uint_fast32_t t2 = a & b;
2247 const uint_fast32_t t3 = t1 | t2;
2248 return t3;
2249 }
2250
2251 SIMDE_FUNCTION_ATTRIBUTES
2252 uint_fast32_t
2253 simde_x_ternarylogic_0xe6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2254 const uint_fast32_t t0 = a & b;
2255 const uint_fast32_t t1 = b ^ c;
2256 const uint_fast32_t t2 = t0 | t1;
2257 return t2;
2258 }
2259
2260 SIMDE_FUNCTION_ATTRIBUTES
2261 uint_fast32_t
2262 simde_x_ternarylogic_0xe7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2263 const uint_fast32_t t0 = b ^ c;
2264 const uint_fast32_t t1 = ~a;
2265 const uint_fast32_t t2 = t1 ^ c;
2266 const uint_fast32_t t3 = t0 | t2;
2267 return t3;
2268 }
2269
2270 SIMDE_FUNCTION_ATTRIBUTES
2271 uint_fast32_t
2272 simde_x_ternarylogic_0xe8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2273 const uint_fast32_t t0 = b & c;
2274 const uint_fast32_t t1 = b ^ c;
2275 const uint_fast32_t t2 = a & t1;
2276 const uint_fast32_t t3 = t0 | t2;
2277 return t3;
2278 }
2279
2280 SIMDE_FUNCTION_ATTRIBUTES
2281 uint_fast32_t
2282 simde_x_ternarylogic_0xe9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2283 const uint_fast32_t t0 = ~a;
2284 const uint_fast32_t t1 = b ^ c;
2285 const uint_fast32_t t2 = t0 ^ t1;
2286 const uint_fast32_t t3 = a & b;
2287 const uint_fast32_t t4 = t2 | t3;
2288 return t4;
2289 }
2290
2291 SIMDE_FUNCTION_ATTRIBUTES
2292 uint_fast32_t
2293 simde_x_ternarylogic_0xea_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2294 const uint_fast32_t t0 = b & a;
2295 const uint_fast32_t t1 = c | t0;
2296 return t1;
2297 }
2298
2299 SIMDE_FUNCTION_ATTRIBUTES
2300 uint_fast32_t
2301 simde_x_ternarylogic_0xeb_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2302 const uint_fast32_t t0 = b ^ a;
2303 const uint_fast32_t t1 = ~t0;
2304 const uint_fast32_t t2 = c | t1;
2305 return t2;
2306 }
2307
2308 SIMDE_FUNCTION_ATTRIBUTES
2309 uint_fast32_t
2310 simde_x_ternarylogic_0xec_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2311 const uint_fast32_t t0 = a & c;
2312 const uint_fast32_t t1 = b | t0;
2313 return t1;
2314 }
2315
2316 SIMDE_FUNCTION_ATTRIBUTES
2317 uint_fast32_t
2318 simde_x_ternarylogic_0xed_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2319 const uint_fast32_t t0 = a ^ c;
2320 const uint_fast32_t t1 = ~t0;
2321 const uint_fast32_t t2 = b | t1;
2322 return t2;
2323 }
2324
2325 SIMDE_FUNCTION_ATTRIBUTES
2326 uint_fast32_t
2327 simde_x_ternarylogic_0xee_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2328 HEDLEY_STATIC_CAST(void, a);
2329 const uint_fast32_t t0 = c | b;
2330 return t0;
2331 }
2332
2333 SIMDE_FUNCTION_ATTRIBUTES
2334 uint_fast32_t
2335 simde_x_ternarylogic_0xef_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2336 const uint_fast32_t t0 = ~a;
2337 const uint_fast32_t t1 = b | c;
2338 const uint_fast32_t t2 = t0 | t1;
2339 return t2;
2340 }
2341
2342 SIMDE_FUNCTION_ATTRIBUTES
2343 uint_fast32_t
2344 simde_x_ternarylogic_0xf0_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2345 HEDLEY_STATIC_CAST(void, b);
2346 HEDLEY_STATIC_CAST(void, c);
2347 return a;
2348 }
2349
2350 SIMDE_FUNCTION_ATTRIBUTES
2351 uint_fast32_t
2352 simde_x_ternarylogic_0xf1_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2353 const uint_fast32_t t0 = b | c;
2354 const uint_fast32_t t1 = ~t0;
2355 const uint_fast32_t t2 = a | t1;
2356 return t2;
2357 }
2358
2359 SIMDE_FUNCTION_ATTRIBUTES
2360 uint_fast32_t
2361 simde_x_ternarylogic_0xf2_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2362 const uint_fast32_t t0 = ~b;
2363 const uint_fast32_t t1 = t0 & c;
2364 const uint_fast32_t t2 = t1 | a;
2365 return t2;
2366 }
2367
2368 SIMDE_FUNCTION_ATTRIBUTES
2369 uint_fast32_t
2370 simde_x_ternarylogic_0xf3_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2371 HEDLEY_STATIC_CAST(void, c);
2372 const uint_fast32_t t0 = ~b;
2373 const uint_fast32_t t1 = a | t0;
2374 return t1;
2375 }
2376
2377 SIMDE_FUNCTION_ATTRIBUTES
2378 uint_fast32_t
2379 simde_x_ternarylogic_0xf4_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2380 const uint_fast32_t t0 = ~c;
2381 const uint_fast32_t t1 = t0 & b;
2382 const uint_fast32_t t2 = t1 | a;
2383 return t2;
2384 }
2385
2386 SIMDE_FUNCTION_ATTRIBUTES
2387 uint_fast32_t
2388 simde_x_ternarylogic_0xf5_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2389 HEDLEY_STATIC_CAST(void, b);
2390 const uint_fast32_t t0 = ~c;
2391 const uint_fast32_t t1 = a | t0;
2392 return t1;
2393 }
2394
2395 SIMDE_FUNCTION_ATTRIBUTES
2396 uint_fast32_t
2397 simde_x_ternarylogic_0xf6_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2398 const uint_fast32_t t0 = b ^ c;
2399 const uint_fast32_t t1 = a | t0;
2400 return t1;
2401 }
2402
2403 SIMDE_FUNCTION_ATTRIBUTES
2404 uint_fast32_t
2405 simde_x_ternarylogic_0xf7_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2406 const uint_fast32_t t0 = b & c;
2407 const uint_fast32_t t1 = ~t0;
2408 const uint_fast32_t t2 = a | t1;
2409 return t2;
2410 }
2411
2412 SIMDE_FUNCTION_ATTRIBUTES
2413 uint_fast32_t
2414 simde_x_ternarylogic_0xf8_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2415 const uint_fast32_t t0 = b & c;
2416 const uint_fast32_t t1 = a | t0;
2417 return t1;
2418 }
2419
2420 SIMDE_FUNCTION_ATTRIBUTES
2421 uint_fast32_t
2422 simde_x_ternarylogic_0xf9_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2423 const uint_fast32_t t0 = b ^ c;
2424 const uint_fast32_t t1 = ~t0;
2425 const uint_fast32_t t2 = a | t1;
2426 return t2;
2427 }
2428
2429 SIMDE_FUNCTION_ATTRIBUTES
2430 uint_fast32_t
2431 simde_x_ternarylogic_0xfa_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2432 HEDLEY_STATIC_CAST(void, b);
2433 const uint_fast32_t t0 = c | a;
2434 return t0;
2435 }
2436
2437 SIMDE_FUNCTION_ATTRIBUTES
2438 uint_fast32_t
2439 simde_x_ternarylogic_0xfb_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2440 const uint_fast32_t t0 = ~b;
2441 const uint_fast32_t t1 = t0 | c;
2442 const uint_fast32_t t2 = a | t1;
2443 return t2;
2444 }
2445
2446 SIMDE_FUNCTION_ATTRIBUTES
2447 uint_fast32_t
2448 simde_x_ternarylogic_0xfc_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2449 HEDLEY_STATIC_CAST(void, c);
2450 const uint_fast32_t t0 = b | a;
2451 return t0;
2452 }
2453
2454 SIMDE_FUNCTION_ATTRIBUTES
2455 uint_fast32_t
2456 simde_x_ternarylogic_0xfd_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2457 const uint_fast32_t t0 = ~c;
2458 const uint_fast32_t t1 = a | b;
2459 const uint_fast32_t t2 = t0 | t1;
2460 return t2;
2461 }
2462
2463 SIMDE_FUNCTION_ATTRIBUTES
2464 uint_fast32_t
2465 simde_x_ternarylogic_0xfe_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2466 const uint_fast32_t t0 = b | c;
2467 const uint_fast32_t t1 = a | t0;
2468 return t1;
2469 }
2470
2471 SIMDE_FUNCTION_ATTRIBUTES
2472 uint_fast32_t
2473 simde_x_ternarylogic_0xff_impl_(uint_fast32_t a, uint_fast32_t b, uint_fast32_t c) {
2474 HEDLEY_STATIC_CAST(void, a);
2475 HEDLEY_STATIC_CAST(void, b);
2476 HEDLEY_STATIC_CAST(void, c);
2477 const uint_fast32_t c1 = ~HEDLEY_STATIC_CAST(uint_fast32_t, 0);
2478 return c1;
2479 }
2480
2481 #define SIMDE_X_TERNARYLOGIC_CASE(value) \
2482 case value: \
2483 SIMDE_VECTORIZE \
2484 for (size_t i = 0 ; i < (sizeof(r_.u32f) / sizeof(r_.u32f[0])) ; i++) { \
2485 r_.u32f[i] = HEDLEY_CONCAT3(simde_x_ternarylogic_, value, _impl_)(a_.u32f[i], b_.u32f[i], c_.u32f[i]); \
2486 } \
2487 break;
2488
2489 #define SIMDE_X_TERNARYLOGIC_SWITCH(value) \
2490 switch(value) { \
2491 SIMDE_X_TERNARYLOGIC_CASE(0x00) \
2492 SIMDE_X_TERNARYLOGIC_CASE(0x01) \
2493 SIMDE_X_TERNARYLOGIC_CASE(0x02) \
2494 SIMDE_X_TERNARYLOGIC_CASE(0x03) \
2495 SIMDE_X_TERNARYLOGIC_CASE(0x04) \
2496 SIMDE_X_TERNARYLOGIC_CASE(0x05) \
2497 SIMDE_X_TERNARYLOGIC_CASE(0x06) \
2498 SIMDE_X_TERNARYLOGIC_CASE(0x07) \
2499 SIMDE_X_TERNARYLOGIC_CASE(0x08) \
2500 SIMDE_X_TERNARYLOGIC_CASE(0x09) \
2501 SIMDE_X_TERNARYLOGIC_CASE(0x0a) \
2502 SIMDE_X_TERNARYLOGIC_CASE(0x0b) \
2503 SIMDE_X_TERNARYLOGIC_CASE(0x0c) \
2504 SIMDE_X_TERNARYLOGIC_CASE(0x0d) \
2505 SIMDE_X_TERNARYLOGIC_CASE(0x0e) \
2506 SIMDE_X_TERNARYLOGIC_CASE(0x0f) \
2507 SIMDE_X_TERNARYLOGIC_CASE(0x10) \
2508 SIMDE_X_TERNARYLOGIC_CASE(0x11) \
2509 SIMDE_X_TERNARYLOGIC_CASE(0x12) \
2510 SIMDE_X_TERNARYLOGIC_CASE(0x13) \
2511 SIMDE_X_TERNARYLOGIC_CASE(0x14) \
2512 SIMDE_X_TERNARYLOGIC_CASE(0x15) \
2513 SIMDE_X_TERNARYLOGIC_CASE(0x16) \
2514 SIMDE_X_TERNARYLOGIC_CASE(0x17) \
2515 SIMDE_X_TERNARYLOGIC_CASE(0x18) \
2516 SIMDE_X_TERNARYLOGIC_CASE(0x19) \
2517 SIMDE_X_TERNARYLOGIC_CASE(0x1a) \
2518 SIMDE_X_TERNARYLOGIC_CASE(0x1b) \
2519 SIMDE_X_TERNARYLOGIC_CASE(0x1c) \
2520 SIMDE_X_TERNARYLOGIC_CASE(0x1d) \
2521 SIMDE_X_TERNARYLOGIC_CASE(0x1e) \
2522 SIMDE_X_TERNARYLOGIC_CASE(0x1f) \
2523 SIMDE_X_TERNARYLOGIC_CASE(0x20) \
2524 SIMDE_X_TERNARYLOGIC_CASE(0x21) \
2525 SIMDE_X_TERNARYLOGIC_CASE(0x22) \
2526 SIMDE_X_TERNARYLOGIC_CASE(0x23) \
2527 SIMDE_X_TERNARYLOGIC_CASE(0x24) \
2528 SIMDE_X_TERNARYLOGIC_CASE(0x25) \
2529 SIMDE_X_TERNARYLOGIC_CASE(0x26) \
2530 SIMDE_X_TERNARYLOGIC_CASE(0x27) \
2531 SIMDE_X_TERNARYLOGIC_CASE(0x28) \
2532 SIMDE_X_TERNARYLOGIC_CASE(0x29) \
2533 SIMDE_X_TERNARYLOGIC_CASE(0x2a) \
2534 SIMDE_X_TERNARYLOGIC_CASE(0x2b) \
2535 SIMDE_X_TERNARYLOGIC_CASE(0x2c) \
2536 SIMDE_X_TERNARYLOGIC_CASE(0x2d) \
2537 SIMDE_X_TERNARYLOGIC_CASE(0x2e) \
2538 SIMDE_X_TERNARYLOGIC_CASE(0x2f) \
2539 SIMDE_X_TERNARYLOGIC_CASE(0x30) \
2540 SIMDE_X_TERNARYLOGIC_CASE(0x31) \
2541 SIMDE_X_TERNARYLOGIC_CASE(0x32) \
2542 SIMDE_X_TERNARYLOGIC_CASE(0x33) \
2543 SIMDE_X_TERNARYLOGIC_CASE(0x34) \
2544 SIMDE_X_TERNARYLOGIC_CASE(0x35) \
2545 SIMDE_X_TERNARYLOGIC_CASE(0x36) \
2546 SIMDE_X_TERNARYLOGIC_CASE(0x37) \
2547 SIMDE_X_TERNARYLOGIC_CASE(0x38) \
2548 SIMDE_X_TERNARYLOGIC_CASE(0x39) \
2549 SIMDE_X_TERNARYLOGIC_CASE(0x3a) \
2550 SIMDE_X_TERNARYLOGIC_CASE(0x3b) \
2551 SIMDE_X_TERNARYLOGIC_CASE(0x3c) \
2552 SIMDE_X_TERNARYLOGIC_CASE(0x3d) \
2553 SIMDE_X_TERNARYLOGIC_CASE(0x3e) \
2554 SIMDE_X_TERNARYLOGIC_CASE(0x3f) \
2555 SIMDE_X_TERNARYLOGIC_CASE(0x40) \
2556 SIMDE_X_TERNARYLOGIC_CASE(0x41) \
2557 SIMDE_X_TERNARYLOGIC_CASE(0x42) \
2558 SIMDE_X_TERNARYLOGIC_CASE(0x43) \
2559 SIMDE_X_TERNARYLOGIC_CASE(0x44) \
2560 SIMDE_X_TERNARYLOGIC_CASE(0x45) \
2561 SIMDE_X_TERNARYLOGIC_CASE(0x46) \
2562 SIMDE_X_TERNARYLOGIC_CASE(0x47) \
2563 SIMDE_X_TERNARYLOGIC_CASE(0x48) \
2564 SIMDE_X_TERNARYLOGIC_CASE(0x49) \
2565 SIMDE_X_TERNARYLOGIC_CASE(0x4a) \
2566 SIMDE_X_TERNARYLOGIC_CASE(0x4b) \
2567 SIMDE_X_TERNARYLOGIC_CASE(0x4c) \
2568 SIMDE_X_TERNARYLOGIC_CASE(0x4d) \
2569 SIMDE_X_TERNARYLOGIC_CASE(0x4e) \
2570 SIMDE_X_TERNARYLOGIC_CASE(0x4f) \
2571 SIMDE_X_TERNARYLOGIC_CASE(0x50) \
2572 SIMDE_X_TERNARYLOGIC_CASE(0x51) \
2573 SIMDE_X_TERNARYLOGIC_CASE(0x52) \
2574 SIMDE_X_TERNARYLOGIC_CASE(0x53) \
2575 SIMDE_X_TERNARYLOGIC_CASE(0x54) \
2576 SIMDE_X_TERNARYLOGIC_CASE(0x55) \
2577 SIMDE_X_TERNARYLOGIC_CASE(0x56) \
2578 SIMDE_X_TERNARYLOGIC_CASE(0x57) \
2579 SIMDE_X_TERNARYLOGIC_CASE(0x58) \
2580 SIMDE_X_TERNARYLOGIC_CASE(0x59) \
2581 SIMDE_X_TERNARYLOGIC_CASE(0x5a) \
2582 SIMDE_X_TERNARYLOGIC_CASE(0x5b) \
2583 SIMDE_X_TERNARYLOGIC_CASE(0x5c) \
2584 SIMDE_X_TERNARYLOGIC_CASE(0x5d) \
2585 SIMDE_X_TERNARYLOGIC_CASE(0x5e) \
2586 SIMDE_X_TERNARYLOGIC_CASE(0x5f) \
2587 SIMDE_X_TERNARYLOGIC_CASE(0x60) \
2588 SIMDE_X_TERNARYLOGIC_CASE(0x61) \
2589 SIMDE_X_TERNARYLOGIC_CASE(0x62) \
2590 SIMDE_X_TERNARYLOGIC_CASE(0x63) \
2591 SIMDE_X_TERNARYLOGIC_CASE(0x64) \
2592 SIMDE_X_TERNARYLOGIC_CASE(0x65) \
2593 SIMDE_X_TERNARYLOGIC_CASE(0x66) \
2594 SIMDE_X_TERNARYLOGIC_CASE(0x67) \
2595 SIMDE_X_TERNARYLOGIC_CASE(0x68) \
2596 SIMDE_X_TERNARYLOGIC_CASE(0x69) \
2597 SIMDE_X_TERNARYLOGIC_CASE(0x6a) \
2598 SIMDE_X_TERNARYLOGIC_CASE(0x6b) \
2599 SIMDE_X_TERNARYLOGIC_CASE(0x6c) \
2600 SIMDE_X_TERNARYLOGIC_CASE(0x6d) \
2601 SIMDE_X_TERNARYLOGIC_CASE(0x6e) \
2602 SIMDE_X_TERNARYLOGIC_CASE(0x6f) \
2603 SIMDE_X_TERNARYLOGIC_CASE(0x70) \
2604 SIMDE_X_TERNARYLOGIC_CASE(0x71) \
2605 SIMDE_X_TERNARYLOGIC_CASE(0x72) \
2606 SIMDE_X_TERNARYLOGIC_CASE(0x73) \
2607 SIMDE_X_TERNARYLOGIC_CASE(0x74) \
2608 SIMDE_X_TERNARYLOGIC_CASE(0x75) \
2609 SIMDE_X_TERNARYLOGIC_CASE(0x76) \
2610 SIMDE_X_TERNARYLOGIC_CASE(0x77) \
2611 SIMDE_X_TERNARYLOGIC_CASE(0x78) \
2612 SIMDE_X_TERNARYLOGIC_CASE(0x79) \
2613 SIMDE_X_TERNARYLOGIC_CASE(0x7a) \
2614 SIMDE_X_TERNARYLOGIC_CASE(0x7b) \
2615 SIMDE_X_TERNARYLOGIC_CASE(0x7c) \
2616 SIMDE_X_TERNARYLOGIC_CASE(0x7d) \
2617 SIMDE_X_TERNARYLOGIC_CASE(0x7e) \
2618 SIMDE_X_TERNARYLOGIC_CASE(0x7f) \
2619 SIMDE_X_TERNARYLOGIC_CASE(0x80) \
2620 SIMDE_X_TERNARYLOGIC_CASE(0x81) \
2621 SIMDE_X_TERNARYLOGIC_CASE(0x82) \
2622 SIMDE_X_TERNARYLOGIC_CASE(0x83) \
2623 SIMDE_X_TERNARYLOGIC_CASE(0x84) \
2624 SIMDE_X_TERNARYLOGIC_CASE(0x85) \
2625 SIMDE_X_TERNARYLOGIC_CASE(0x86) \
2626 SIMDE_X_TERNARYLOGIC_CASE(0x87) \
2627 SIMDE_X_TERNARYLOGIC_CASE(0x88) \
2628 SIMDE_X_TERNARYLOGIC_CASE(0x89) \
2629 SIMDE_X_TERNARYLOGIC_CASE(0x8a) \
2630 SIMDE_X_TERNARYLOGIC_CASE(0x8b) \
2631 SIMDE_X_TERNARYLOGIC_CASE(0x8c) \
2632 SIMDE_X_TERNARYLOGIC_CASE(0x8d) \
2633 SIMDE_X_TERNARYLOGIC_CASE(0x8e) \
2634 SIMDE_X_TERNARYLOGIC_CASE(0x8f) \
2635 SIMDE_X_TERNARYLOGIC_CASE(0x90) \
2636 SIMDE_X_TERNARYLOGIC_CASE(0x91) \
2637 SIMDE_X_TERNARYLOGIC_CASE(0x92) \
2638 SIMDE_X_TERNARYLOGIC_CASE(0x93) \
2639 SIMDE_X_TERNARYLOGIC_CASE(0x94) \
2640 SIMDE_X_TERNARYLOGIC_CASE(0x95) \
2641 SIMDE_X_TERNARYLOGIC_CASE(0x96) \
2642 SIMDE_X_TERNARYLOGIC_CASE(0x97) \
2643 SIMDE_X_TERNARYLOGIC_CASE(0x98) \
2644 SIMDE_X_TERNARYLOGIC_CASE(0x99) \
2645 SIMDE_X_TERNARYLOGIC_CASE(0x9a) \
2646 SIMDE_X_TERNARYLOGIC_CASE(0x9b) \
2647 SIMDE_X_TERNARYLOGIC_CASE(0x9c) \
2648 SIMDE_X_TERNARYLOGIC_CASE(0x9d) \
2649 SIMDE_X_TERNARYLOGIC_CASE(0x9e) \
2650 SIMDE_X_TERNARYLOGIC_CASE(0x9f) \
2651 SIMDE_X_TERNARYLOGIC_CASE(0xa0) \
2652 SIMDE_X_TERNARYLOGIC_CASE(0xa1) \
2653 SIMDE_X_TERNARYLOGIC_CASE(0xa2) \
2654 SIMDE_X_TERNARYLOGIC_CASE(0xa3) \
2655 SIMDE_X_TERNARYLOGIC_CASE(0xa4) \
2656 SIMDE_X_TERNARYLOGIC_CASE(0xa5) \
2657 SIMDE_X_TERNARYLOGIC_CASE(0xa6) \
2658 SIMDE_X_TERNARYLOGIC_CASE(0xa7) \
2659 SIMDE_X_TERNARYLOGIC_CASE(0xa8) \
2660 SIMDE_X_TERNARYLOGIC_CASE(0xa9) \
2661 SIMDE_X_TERNARYLOGIC_CASE(0xaa) \
2662 SIMDE_X_TERNARYLOGIC_CASE(0xab) \
2663 SIMDE_X_TERNARYLOGIC_CASE(0xac) \
2664 SIMDE_X_TERNARYLOGIC_CASE(0xad) \
2665 SIMDE_X_TERNARYLOGIC_CASE(0xae) \
2666 SIMDE_X_TERNARYLOGIC_CASE(0xaf) \
2667 SIMDE_X_TERNARYLOGIC_CASE(0xb0) \
2668 SIMDE_X_TERNARYLOGIC_CASE(0xb1) \
2669 SIMDE_X_TERNARYLOGIC_CASE(0xb2) \
2670 SIMDE_X_TERNARYLOGIC_CASE(0xb3) \
2671 SIMDE_X_TERNARYLOGIC_CASE(0xb4) \
2672 SIMDE_X_TERNARYLOGIC_CASE(0xb5) \
2673 SIMDE_X_TERNARYLOGIC_CASE(0xb6) \
2674 SIMDE_X_TERNARYLOGIC_CASE(0xb7) \
2675 SIMDE_X_TERNARYLOGIC_CASE(0xb8) \
2676 SIMDE_X_TERNARYLOGIC_CASE(0xb9) \
2677 SIMDE_X_TERNARYLOGIC_CASE(0xba) \
2678 SIMDE_X_TERNARYLOGIC_CASE(0xbb) \
2679 SIMDE_X_TERNARYLOGIC_CASE(0xbc) \
2680 SIMDE_X_TERNARYLOGIC_CASE(0xbd) \
2681 SIMDE_X_TERNARYLOGIC_CASE(0xbe) \
2682 SIMDE_X_TERNARYLOGIC_CASE(0xbf) \
2683 SIMDE_X_TERNARYLOGIC_CASE(0xc0) \
2684 SIMDE_X_TERNARYLOGIC_CASE(0xc1) \
2685 SIMDE_X_TERNARYLOGIC_CASE(0xc2) \
2686 SIMDE_X_TERNARYLOGIC_CASE(0xc3) \
2687 SIMDE_X_TERNARYLOGIC_CASE(0xc4) \
2688 SIMDE_X_TERNARYLOGIC_CASE(0xc5) \
2689 SIMDE_X_TERNARYLOGIC_CASE(0xc6) \
2690 SIMDE_X_TERNARYLOGIC_CASE(0xc7) \
2691 SIMDE_X_TERNARYLOGIC_CASE(0xc8) \
2692 SIMDE_X_TERNARYLOGIC_CASE(0xc9) \
2693 SIMDE_X_TERNARYLOGIC_CASE(0xca) \
2694 SIMDE_X_TERNARYLOGIC_CASE(0xcb) \
2695 SIMDE_X_TERNARYLOGIC_CASE(0xcc) \
2696 SIMDE_X_TERNARYLOGIC_CASE(0xcd) \
2697 SIMDE_X_TERNARYLOGIC_CASE(0xce) \
2698 SIMDE_X_TERNARYLOGIC_CASE(0xcf) \
2699 SIMDE_X_TERNARYLOGIC_CASE(0xd0) \
2700 SIMDE_X_TERNARYLOGIC_CASE(0xd1) \
2701 SIMDE_X_TERNARYLOGIC_CASE(0xd2) \
2702 SIMDE_X_TERNARYLOGIC_CASE(0xd3) \
2703 SIMDE_X_TERNARYLOGIC_CASE(0xd4) \
2704 SIMDE_X_TERNARYLOGIC_CASE(0xd5) \
2705 SIMDE_X_TERNARYLOGIC_CASE(0xd6) \
2706 SIMDE_X_TERNARYLOGIC_CASE(0xd7) \
2707 SIMDE_X_TERNARYLOGIC_CASE(0xd8) \
2708 SIMDE_X_TERNARYLOGIC_CASE(0xd9) \
2709 SIMDE_X_TERNARYLOGIC_CASE(0xda) \
2710 SIMDE_X_TERNARYLOGIC_CASE(0xdb) \
2711 SIMDE_X_TERNARYLOGIC_CASE(0xdc) \
2712 SIMDE_X_TERNARYLOGIC_CASE(0xdd) \
2713 SIMDE_X_TERNARYLOGIC_CASE(0xde) \
2714 SIMDE_X_TERNARYLOGIC_CASE(0xdf) \
2715 SIMDE_X_TERNARYLOGIC_CASE(0xe0) \
2716 SIMDE_X_TERNARYLOGIC_CASE(0xe1) \
2717 SIMDE_X_TERNARYLOGIC_CASE(0xe2) \
2718 SIMDE_X_TERNARYLOGIC_CASE(0xe3) \
2719 SIMDE_X_TERNARYLOGIC_CASE(0xe4) \
2720 SIMDE_X_TERNARYLOGIC_CASE(0xe5) \
2721 SIMDE_X_TERNARYLOGIC_CASE(0xe6) \
2722 SIMDE_X_TERNARYLOGIC_CASE(0xe7) \
2723 SIMDE_X_TERNARYLOGIC_CASE(0xe8) \
2724 SIMDE_X_TERNARYLOGIC_CASE(0xe9) \
2725 SIMDE_X_TERNARYLOGIC_CASE(0xea) \
2726 SIMDE_X_TERNARYLOGIC_CASE(0xeb) \
2727 SIMDE_X_TERNARYLOGIC_CASE(0xec) \
2728 SIMDE_X_TERNARYLOGIC_CASE(0xed) \
2729 SIMDE_X_TERNARYLOGIC_CASE(0xee) \
2730 SIMDE_X_TERNARYLOGIC_CASE(0xef) \
2731 SIMDE_X_TERNARYLOGIC_CASE(0xf0) \
2732 SIMDE_X_TERNARYLOGIC_CASE(0xf1) \
2733 SIMDE_X_TERNARYLOGIC_CASE(0xf2) \
2734 SIMDE_X_TERNARYLOGIC_CASE(0xf3) \
2735 SIMDE_X_TERNARYLOGIC_CASE(0xf4) \
2736 SIMDE_X_TERNARYLOGIC_CASE(0xf5) \
2737 SIMDE_X_TERNARYLOGIC_CASE(0xf6) \
2738 SIMDE_X_TERNARYLOGIC_CASE(0xf7) \
2739 SIMDE_X_TERNARYLOGIC_CASE(0xf8) \
2740 SIMDE_X_TERNARYLOGIC_CASE(0xf9) \
2741 SIMDE_X_TERNARYLOGIC_CASE(0xfa) \
2742 SIMDE_X_TERNARYLOGIC_CASE(0xfb) \
2743 SIMDE_X_TERNARYLOGIC_CASE(0xfc) \
2744 SIMDE_X_TERNARYLOGIC_CASE(0xfd) \
2745 SIMDE_X_TERNARYLOGIC_CASE(0xfe) \
2746 SIMDE_X_TERNARYLOGIC_CASE(0xff) \
2747 }
2748
2749 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
2750 #define simde_mm_ternarylogic_epi32(a, b, c, imm8) _mm_ternarylogic_epi32(a, b, c, imm8)
2751 #else
2752 SIMDE_HUGE_FUNCTION_ATTRIBUTES
2753 simde__m128i
2754 simde_mm_ternarylogic_epi32(simde__m128i a, simde__m128i b, simde__m128i c, int imm8)
2755 SIMDE_REQUIRE_CONSTANT_RANGE(imm8, 0, 255) {
2756 simde__m128i_private
2757 r_,
2758 a_ = simde__m128i_to_private(a),
2759 b_ = simde__m128i_to_private(b),
2760 c_ = simde__m128i_to_private(c);
2761
2762 #if defined(SIMDE_TERNARYLOGIC_COMPRESSION)
2763 int to_do, mask;
2764 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
2765 simde__m128i_private t_;
2766 to_do = imm8;
2767
2768 r_.u64 = a_.u64 ^ a_.u64;
2769
2770 mask = 0xFF;
2771 if ((to_do & mask) == mask) {
2772 r_.u64 = ~r_.u64;
2773 to_do &= ~mask;
2774 }
2775
2776 mask = 0xF0;
2777 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2778 r_.u64 = a_.u64;
2779 to_do &= ~mask;
2780 }
2781
2782 mask = 0xCC;
2783 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2784 r_.u64 |= b_.u64;
2785 to_do &= ~mask;
2786 }
2787
2788 mask = 0xAA;
2789 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2790 r_.u64 |= c_.u64;
2791 to_do &= ~mask;
2792 }
2793
2794 mask = 0x0F;
2795 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2796 r_.u64 |= ~a_.u64;
2797 to_do &= ~mask;
2798 }
2799
2800 mask = 0x33;
2801 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2802 r_.u64 |= ~b_.u64;
2803 to_do &= ~mask;
2804 }
2805
2806 mask = 0x55;
2807 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2808 r_.u64 |= ~c_.u64;
2809 to_do &= ~mask;
2810 }
2811
2812 mask = 0x3C;
2813 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2814 r_.u64 |= a_.u64 ^ b_.u64;
2815 to_do &= ~mask;
2816 }
2817
2818 mask = 0x5A;
2819 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2820 r_.u64 |= a_.u64 ^ c_.u64;
2821 to_do &= ~mask;
2822 }
2823
2824 mask = 0x66;
2825 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2826 r_.u64 |= b_.u64 ^ c_.u64;
2827 to_do &= ~mask;
2828 }
2829
2830 mask = 0xA0;
2831 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2832 r_.u64 |= a_.u64 & c_.u64;
2833 to_do &= ~mask;
2834 }
2835
2836 mask = 0x50;
2837 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2838 r_.u64 |= ~c_.u64 & a_.u64;
2839 to_do &= ~mask;
2840 }
2841
2842 mask = 0x0A;
2843 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2844 r_.u64 |= ~a_.u64 & c_.u64;
2845 to_do &= ~mask;
2846 }
2847
2848 mask = 0x88;
2849 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2850 r_.u64 |= b_.u64 & c_.u64;
2851 to_do &= ~mask;
2852 }
2853
2854 mask = 0x44;
2855 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2856 r_.u64 |= ~c_.u64 & b_.u64;
2857 to_do &= ~mask;
2858 }
2859
2860 mask = 0x22;
2861 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2862 r_.u64 |= ~b_.u64 & c_.u64;
2863 to_do &= ~mask;
2864 }
2865
2866 if (to_do & 0xc0) {
2867 t_.u64 = a_.u64 & b_.u64;
2868 if ((to_do & 0xc0) == 0xc0) r_.u64 |= t_.u64;
2869 else if (to_do & 0x80) r_.u64 |= c_.u64 & t_.u64;
2870 else r_.u64 |= ~c_.u64 & t_.u64;
2871 }
2872
2873 if (to_do & 0x30) {
2874 t_.u64 = ~b_.u64 & a_.u64;
2875 if ((to_do & 0x30) == 0x30) r_.u64 |= t_.u64;
2876 else if (to_do & 0x20) r_.u64 |= c_.u64 & t_.u64;
2877 else r_.u64 |= ~c_.u64 & t_.u64;
2878 }
2879
2880 if (to_do & 0x0c) {
2881 t_.u64 = ~a_.u64 & b_.u64;
2882 if ((to_do & 0x0c) == 0x0c) r_.u64 |= t_.u64;
2883 else if (to_do & 0x08) r_.u64 |= c_.u64 & t_.u64;
2884 else r_.u64 |= ~c_.u64 & t_.u64;
2885 }
2886
2887 if (to_do & 0x03) {
2888 t_.u64 = ~(a_.u64 | b_.u64);
2889 if ((to_do & 0x03) == 0x03) r_.u64 |= t_.u64;
2890 else if (to_do & 0x02) r_.u64 |= c_.u64 & t_.u64;
2891 else r_.u64 |= ~c_.u64 & t_.u64;
2892 }
2893 #else
2894 uint64_t t;
2895
2896 SIMDE_VECTORIZE
2897 for (size_t i = 0 ; i < (sizeof(r_.u64) / sizeof(r_.u64[0])) ; i++) {
2898 to_do = imm8;
2899
2900 mask = 0xFF;
2901 if ((to_do & mask) == mask) {
2902 r_.u64[i] = UINT64_MAX;
2903 to_do &= ~mask;
2904 }
2905 else r_.u64[i] = 0;
2906
2907 mask = 0xF0;
2908 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2909 r_.u64[i] = a_.u64[i];
2910 to_do &= ~mask;
2911 }
2912
2913 mask = 0xCC;
2914 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2915 r_.u64[i] |= b_.u64[i];
2916 to_do &= ~mask;
2917 }
2918
2919 mask = 0xAA;
2920 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2921 r_.u64[i] |= c_.u64[i];
2922 to_do &= ~mask;
2923 }
2924
2925 mask = 0x0F;
2926 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2927 r_.u64[i] |= ~a_.u64[i];
2928 to_do &= ~mask;
2929 }
2930
2931 mask = 0x33;
2932 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2933 r_.u64[i] |= ~b_.u64[i];
2934 to_do &= ~mask;
2935 }
2936
2937 mask = 0x55;
2938 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2939 r_.u64[i] |= ~c_.u64[i];
2940 to_do &= ~mask;
2941 }
2942
2943 mask = 0x3C;
2944 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2945 r_.u64[i] |= a_.u64[i] ^ b_.u64[i];
2946 to_do &= ~mask;
2947 }
2948
2949 mask = 0x5A;
2950 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2951 r_.u64[i] |= a_.u64[i] ^ c_.u64[i];
2952 to_do &= ~mask;
2953 }
2954
2955 mask = 0x66;
2956 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2957 r_.u64[i] |= b_.u64[i] ^ c_.u64[i];
2958 to_do &= ~mask;
2959 }
2960
2961 mask = 0xA0;
2962 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2963 r_.u64[i] |= a_.u64[i] & c_.u64[i];
2964 to_do &= ~mask;
2965 }
2966
2967 mask = 0x50;
2968 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2969 r_.u64[i] |= ~c_.u64[i] & a_.u64[i];
2970 to_do &= ~mask;
2971 }
2972
2973 mask = 0x0A;
2974 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2975 r_.u64[i] |= ~a_.u64[i] & c_.u64[i];
2976 to_do &= ~mask;
2977 }
2978
2979 mask = 0x88;
2980 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2981 r_.u64[i] |= b_.u64[i] & c_.u64[i];
2982 to_do &= ~mask;
2983 }
2984
2985 mask = 0x44;
2986 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2987 r_.u64[i] |= ~c_.u64[i] & b_.u64[i];
2988 to_do &= ~mask;
2989 }
2990
2991 mask = 0x22;
2992 if ((to_do & mask) && ((imm8 & mask) == mask)) {
2993 r_.u64[i] |= ~b_.u64[i] & c_.u64[i];
2994 to_do &= ~mask;
2995 }
2996
2997 if (to_do & 0xc0) {
2998 t = a_.u64[i] & b_.u64[i];
2999 if ((to_do & 0xc0) == 0xc0) r_.u64[i] |= t;
3000 else if (to_do & 0x80) r_.u64[i] |= c_.u64[i] & t;
3001 else r_.u64[i] |= ~c_.u64[i] & t;
3002 }
3003
3004 if (to_do & 0x30) {
3005 t = ~b_.u64[i] & a_.u64[i];
3006 if ((to_do & 0x30) == 0x30) r_.u64[i] |= t;
3007 else if (to_do & 0x20) r_.u64[i] |= c_.u64[i] & t;
3008 else r_.u64[i] |= ~c_.u64[i] & t;
3009 }
3010
3011 if (to_do & 0x0c) {
3012 t = ~a_.u64[i] & b_.u64[i];
3013 if ((to_do & 0x0c) == 0x0c) r_.u64[i] |= t;
3014 else if (to_do & 0x08) r_.u64[i] |= c_.u64[i] & t;
3015 else r_.u64[i] |= ~c_.u64[i] & t;
3016 }
3017
3018 if (to_do & 0x03) {
3019 t = ~(a_.u64[i] | b_.u64[i]);
3020 if ((to_do & 0x03) == 0x03) r_.u64[i] |= t;
3021 else if (to_do & 0x02) r_.u64[i] |= c_.u64[i] & t;
3022 else r_.u64[i] |= ~c_.u64[i] & t;
3023 }
3024 }
3025 #endif
3026 #else
3027 SIMDE_X_TERNARYLOGIC_SWITCH(imm8 & 255)
3028 #endif
3029
3030 return simde__m128i_from_private(r_);
3031 }
3032 #endif
3033 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3034 #undef _mm_ternarylogic_epi32
3035 #define _mm_ternarylogic_epi32(a, b, c, imm8) simde_mm_ternarylogic_epi32(a, b, c, imm8)
3036 #endif
3037
3038 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
3039 #define simde_mm_mask_ternarylogic_epi32(src, k, a, b, imm8) _mm_mask_ternarylogic_epi32(src, k, a, b, imm8)
3040 #else
3041 #define simde_mm_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm_mask_mov_epi32(src, k, simde_mm_ternarylogic_epi32(src, a, b, imm8))
3042 #endif
3043 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3044 #undef _mm_mask_ternarylogic_epi32
3045 #define _mm_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm_mask_ternarylogic_epi32(src, k, a, b, imm8)
3046 #endif
3047
3048 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
3049 #define simde_mm_maskz_ternarylogic_epi32(k, a, b, c, imm8) _mm_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3050 #else
3051 #define simde_mm_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm_maskz_mov_epi32(k, simde_mm_ternarylogic_epi32(a, b, c, imm8))
3052 #endif
3053 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3054 #undef _mm_maskz_ternarylogic_epi32
3055 #define _mm_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3056 #endif
3057
3058 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
3059 #define simde_mm256_ternarylogic_epi32(a, b, c, imm8) _mm256_ternarylogic_epi32(a, b, c, imm8)
3060 #else
3061 SIMDE_HUGE_FUNCTION_ATTRIBUTES
3062 simde__m256i
3063 simde_mm256_ternarylogic_epi32(simde__m256i a, simde__m256i b, simde__m256i c, int imm8)
3064 SIMDE_REQUIRE_CONSTANT_RANGE(imm8, 0, 255) {
3065 simde__m256i_private
3066 r_,
3067 a_ = simde__m256i_to_private(a),
3068 b_ = simde__m256i_to_private(b),
3069 c_ = simde__m256i_to_private(c);
3070
3071 #if defined(SIMDE_TERNARYLOGIC_COMPRESSION)
3072 int to_do, mask;
3073 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
3074 simde__m256i_private t_;
3075 to_do = imm8;
3076
3077 r_.u64 = a_.u64 ^ a_.u64;
3078
3079 mask = 0xFF;
3080 if ((to_do & mask) == mask) {
3081 r_.u64 = ~r_.u64;
3082 to_do &= ~mask;
3083 }
3084
3085 mask = 0xF0;
3086 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3087 r_.u64 = a_.u64;
3088 to_do &= ~mask;
3089 }
3090
3091 mask = 0xCC;
3092 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3093 r_.u64 |= b_.u64;
3094 to_do &= ~mask;
3095 }
3096
3097 mask = 0xAA;
3098 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3099 r_.u64 |= c_.u64;
3100 to_do &= ~mask;
3101 }
3102
3103 mask = 0x0F;
3104 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3105 r_.u64 |= ~a_.u64;
3106 to_do &= ~mask;
3107 }
3108
3109 mask = 0x33;
3110 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3111 r_.u64 |= ~b_.u64;
3112 to_do &= ~mask;
3113 }
3114
3115 mask = 0x55;
3116 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3117 r_.u64 |= ~c_.u64;
3118 to_do &= ~mask;
3119 }
3120
3121 mask = 0x3C;
3122 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3123 r_.u64 |= a_.u64 ^ b_.u64;
3124 to_do &= ~mask;
3125 }
3126
3127 mask = 0x5A;
3128 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3129 r_.u64 |= a_.u64 ^ c_.u64;
3130 to_do &= ~mask;
3131 }
3132
3133 mask = 0x66;
3134 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3135 r_.u64 |= b_.u64 ^ c_.u64;
3136 to_do &= ~mask;
3137 }
3138
3139 mask = 0xA0;
3140 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3141 r_.u64 |= a_.u64 & c_.u64;
3142 to_do &= ~mask;
3143 }
3144
3145 mask = 0x50;
3146 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3147 r_.u64 |= ~c_.u64 & a_.u64;
3148 to_do &= ~mask;
3149 }
3150
3151 mask = 0x0A;
3152 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3153 r_.u64 |= ~a_.u64 & c_.u64;
3154 to_do &= ~mask;
3155 }
3156
3157 mask = 0x88;
3158 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3159 r_.u64 |= b_.u64 & c_.u64;
3160 to_do &= ~mask;
3161 }
3162
3163 mask = 0x44;
3164 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3165 r_.u64 |= ~c_.u64 & b_.u64;
3166 to_do &= ~mask;
3167 }
3168
3169 mask = 0x22;
3170 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3171 r_.u64 |= ~b_.u64 & c_.u64;
3172 to_do &= ~mask;
3173 }
3174
3175 if (to_do & 0xc0) {
3176 t_.u64 = a_.u64 & b_.u64;
3177 if ((to_do & 0xc0) == 0xc0) r_.u64 |= t_.u64;
3178 else if (to_do & 0x80) r_.u64 |= c_.u64 & t_.u64;
3179 else r_.u64 |= ~c_.u64 & t_.u64;
3180 }
3181
3182 if (to_do & 0x30) {
3183 t_.u64 = ~b_.u64 & a_.u64;
3184 if ((to_do & 0x30) == 0x30) r_.u64 |= t_.u64;
3185 else if (to_do & 0x20) r_.u64 |= c_.u64 & t_.u64;
3186 else r_.u64 |= ~c_.u64 & t_.u64;
3187 }
3188
3189 if (to_do & 0x0c) {
3190 t_.u64 = ~a_.u64 & b_.u64;
3191 if ((to_do & 0x0c) == 0x0c) r_.u64 |= t_.u64;
3192 else if (to_do & 0x08) r_.u64 |= c_.u64 & t_.u64;
3193 else r_.u64 |= ~c_.u64 & t_.u64;
3194 }
3195
3196 if (to_do & 0x03) {
3197 t_.u64 = ~(a_.u64 | b_.u64);
3198 if ((to_do & 0x03) == 0x03) r_.u64 |= t_.u64;
3199 else if (to_do & 0x02) r_.u64 |= c_.u64 & t_.u64;
3200 else r_.u64 |= ~c_.u64 & t_.u64;
3201 }
3202 #else
3203 uint64_t t;
3204
3205 SIMDE_VECTORIZE
3206 for (size_t i = 0 ; i < (sizeof(r_.u64) / sizeof(r_.u64[0])) ; i++) {
3207 to_do = imm8;
3208
3209 mask = 0xFF;
3210 if ((to_do & mask) == mask) {
3211 r_.u64[i] = UINT64_MAX;
3212 to_do &= ~mask;
3213 }
3214 else r_.u64[i] = 0;
3215
3216 mask = 0xF0;
3217 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3218 r_.u64[i] = a_.u64[i];
3219 to_do &= ~mask;
3220 }
3221
3222 mask = 0xCC;
3223 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3224 r_.u64[i] |= b_.u64[i];
3225 to_do &= ~mask;
3226 }
3227
3228 mask = 0xAA;
3229 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3230 r_.u64[i] |= c_.u64[i];
3231 to_do &= ~mask;
3232 }
3233
3234 mask = 0x0F;
3235 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3236 r_.u64[i] |= ~a_.u64[i];
3237 to_do &= ~mask;
3238 }
3239
3240 mask = 0x33;
3241 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3242 r_.u64[i] |= ~b_.u64[i];
3243 to_do &= ~mask;
3244 }
3245
3246 mask = 0x55;
3247 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3248 r_.u64[i] |= ~c_.u64[i];
3249 to_do &= ~mask;
3250 }
3251
3252 mask = 0x3C;
3253 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3254 r_.u64[i] |= a_.u64[i] ^ b_.u64[i];
3255 to_do &= ~mask;
3256 }
3257
3258 mask = 0x5A;
3259 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3260 r_.u64[i] |= a_.u64[i] ^ c_.u64[i];
3261 to_do &= ~mask;
3262 }
3263
3264 mask = 0x66;
3265 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3266 r_.u64[i] |= b_.u64[i] ^ c_.u64[i];
3267 to_do &= ~mask;
3268 }
3269
3270 mask = 0xA0;
3271 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3272 r_.u64[i] |= a_.u64[i] & c_.u64[i];
3273 to_do &= ~mask;
3274 }
3275
3276 mask = 0x50;
3277 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3278 r_.u64[i] |= ~c_.u64[i] & a_.u64[i];
3279 to_do &= ~mask;
3280 }
3281
3282 mask = 0x0A;
3283 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3284 r_.u64[i] |= ~a_.u64[i] & c_.u64[i];
3285 to_do &= ~mask;
3286 }
3287
3288 mask = 0x88;
3289 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3290 r_.u64[i] |= b_.u64[i] & c_.u64[i];
3291 to_do &= ~mask;
3292 }
3293
3294 mask = 0x44;
3295 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3296 r_.u64[i] |= ~c_.u64[i] & b_.u64[i];
3297 to_do &= ~mask;
3298 }
3299
3300 mask = 0x22;
3301 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3302 r_.u64[i] |= ~b_.u64[i] & c_.u64[i];
3303 to_do &= ~mask;
3304 }
3305
3306 if (to_do & 0xc0) {
3307 t = a_.u64[i] & b_.u64[i];
3308 if ((to_do & 0xc0) == 0xc0) r_.u64[i] |= t;
3309 else if (to_do & 0x80) r_.u64[i] |= c_.u64[i] & t;
3310 else r_.u64[i] |= ~c_.u64[i] & t;
3311 }
3312
3313 if (to_do & 0x30) {
3314 t = ~b_.u64[i] & a_.u64[i];
3315 if ((to_do & 0x30) == 0x30) r_.u64[i] |= t;
3316 else if (to_do & 0x20) r_.u64[i] |= c_.u64[i] & t;
3317 else r_.u64[i] |= ~c_.u64[i] & t;
3318 }
3319
3320 if (to_do & 0x0c) {
3321 t = ~a_.u64[i] & b_.u64[i];
3322 if ((to_do & 0x0c) == 0x0c) r_.u64[i] |= t;
3323 else if (to_do & 0x08) r_.u64[i] |= c_.u64[i] & t;
3324 else r_.u64[i] |= ~c_.u64[i] & t;
3325 }
3326
3327 if (to_do & 0x03) {
3328 t = ~(a_.u64[i] | b_.u64[i]);
3329 if ((to_do & 0x03) == 0x03) r_.u64[i] |= t;
3330 else if (to_do & 0x02) r_.u64[i] |= c_.u64[i] & t;
3331 else r_.u64[i] |= ~c_.u64[i] & t;
3332 }
3333 }
3334 #endif
3335 #else
3336 SIMDE_X_TERNARYLOGIC_SWITCH(imm8 & 255)
3337 #endif
3338
3339 return simde__m256i_from_private(r_);
3340 }
3341 #endif
3342 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3343 #undef _mm256_ternarylogic_epi32
3344 #define _mm256_ternarylogic_epi32(a, b, c, imm8) simde_mm256_ternarylogic_epi32(a, b, c, imm8)
3345 #endif
3346
3347 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
3348 #define simde_mm256_mask_ternarylogic_epi32(src, k, a, b, imm8) _mm256_mask_ternarylogic_epi32(src, k, a, b, imm8)
3349 #else
3350 #define simde_mm256_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm256_mask_mov_epi32(src, k, simde_mm256_ternarylogic_epi32(src, a, b, imm8))
3351 #endif
3352 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3353 #undef _mm256_mask_ternarylogic_epi32
3354 #define _mm256_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm256_mask_ternarylogic_epi32(src, k, a, b, imm8)
3355 #endif
3356
3357 #if defined(SIMDE_X86_AVX512VL_NATIVE) && defined(SIMDE_X86_AVX512F_NATIVE)
3358 #define simde_mm256_maskz_ternarylogic_epi32(k, a, b, c, imm8) _mm256_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3359 #else
3360 #define simde_mm256_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm256_maskz_mov_epi32(k, simde_mm256_ternarylogic_epi32(a, b, c, imm8))
3361 #endif
3362 #if defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3363 #undef _mm256_maskz_ternarylogic_epi32
3364 #define _mm256_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm256_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3365 #endif
3366
3367 #if defined(SIMDE_X86_AVX512F_NATIVE)
3368 #define simde_mm512_ternarylogic_epi32(a, b, c, imm8) _mm512_ternarylogic_epi32(a, b, c, imm8)
3369 #else
3370 SIMDE_HUGE_FUNCTION_ATTRIBUTES
3371 simde__m512i
3372 simde_mm512_ternarylogic_epi32(simde__m512i a, simde__m512i b, simde__m512i c, int imm8)
3373 SIMDE_REQUIRE_CONSTANT_RANGE(imm8, 0, 255) {
3374 simde__m512i_private
3375 r_,
3376 a_ = simde__m512i_to_private(a),
3377 b_ = simde__m512i_to_private(b),
3378 c_ = simde__m512i_to_private(c);
3379
3380 #if defined(SIMDE_TERNARYLOGIC_COMPRESSION)
3381 int to_do, mask;
3382 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
3383 simde__m512i_private t_;
3384 to_do = imm8;
3385
3386 r_.u64 = a_.u64 ^ a_.u64;
3387
3388 mask = 0xFF;
3389 if ((to_do & mask) == mask) {
3390 r_.u64 = ~r_.u64;
3391 to_do &= ~mask;
3392 }
3393
3394 mask = 0xF0;
3395 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3396 r_.u64 = a_.u64;
3397 to_do &= ~mask;
3398 }
3399
3400 mask = 0xCC;
3401 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3402 r_.u64 |= b_.u64;
3403 to_do &= ~mask;
3404 }
3405
3406 mask = 0xAA;
3407 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3408 r_.u64 |= c_.u64;
3409 to_do &= ~mask;
3410 }
3411
3412 mask = 0x0F;
3413 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3414 r_.u64 |= ~a_.u64;
3415 to_do &= ~mask;
3416 }
3417
3418 mask = 0x33;
3419 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3420 r_.u64 |= ~b_.u64;
3421 to_do &= ~mask;
3422 }
3423
3424 mask = 0x55;
3425 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3426 r_.u64 |= ~c_.u64;
3427 to_do &= ~mask;
3428 }
3429
3430 mask = 0x3C;
3431 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3432 r_.u64 |= a_.u64 ^ b_.u64;
3433 to_do &= ~mask;
3434 }
3435
3436 mask = 0x5A;
3437 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3438 r_.u64 |= a_.u64 ^ c_.u64;
3439 to_do &= ~mask;
3440 }
3441
3442 mask = 0x66;
3443 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3444 r_.u64 |= b_.u64 ^ c_.u64;
3445 to_do &= ~mask;
3446 }
3447
3448 mask = 0xA0;
3449 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3450 r_.u64 |= a_.u64 & c_.u64;
3451 to_do &= ~mask;
3452 }
3453
3454 mask = 0x50;
3455 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3456 r_.u64 |= ~c_.u64 & a_.u64;
3457 to_do &= ~mask;
3458 }
3459
3460 mask = 0x0A;
3461 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3462 r_.u64 |= ~a_.u64 & c_.u64;
3463 to_do &= ~mask;
3464 }
3465
3466 mask = 0x88;
3467 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3468 r_.u64 |= b_.u64 & c_.u64;
3469 to_do &= ~mask;
3470 }
3471
3472 mask = 0x44;
3473 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3474 r_.u64 |= ~c_.u64 & b_.u64;
3475 to_do &= ~mask;
3476 }
3477
3478 mask = 0x22;
3479 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3480 r_.u64 |= ~b_.u64 & c_.u64;
3481 to_do &= ~mask;
3482 }
3483
3484 if (to_do & 0xc0) {
3485 t_.u64 = a_.u64 & b_.u64;
3486 if ((to_do & 0xc0) == 0xc0) r_.u64 |= t_.u64;
3487 else if (to_do & 0x80) r_.u64 |= c_.u64 & t_.u64;
3488 else r_.u64 |= ~c_.u64 & t_.u64;
3489 }
3490
3491 if (to_do & 0x30) {
3492 t_.u64 = ~b_.u64 & a_.u64;
3493 if ((to_do & 0x30) == 0x30) r_.u64 |= t_.u64;
3494 else if (to_do & 0x20) r_.u64 |= c_.u64 & t_.u64;
3495 else r_.u64 |= ~c_.u64 & t_.u64;
3496 }
3497
3498 if (to_do & 0x0c) {
3499 t_.u64 = ~a_.u64 & b_.u64;
3500 if ((to_do & 0x0c) == 0x0c) r_.u64 |= t_.u64;
3501 else if (to_do & 0x08) r_.u64 |= c_.u64 & t_.u64;
3502 else r_.u64 |= ~c_.u64 & t_.u64;
3503 }
3504
3505 if (to_do & 0x03) {
3506 t_.u64 = ~(a_.u64 | b_.u64);
3507 if ((to_do & 0x03) == 0x03) r_.u64 |= t_.u64;
3508 else if (to_do & 0x02) r_.u64 |= c_.u64 & t_.u64;
3509 else r_.u64 |= ~c_.u64 & t_.u64;
3510 }
3511 #else
3512 uint64_t t;
3513
3514 SIMDE_VECTORIZE
3515 for (size_t i = 0 ; i < (sizeof(r_.u64) / sizeof(r_.u64[0])) ; i++) {
3516 to_do = imm8;
3517
3518 mask = 0xFF;
3519 if ((to_do & mask) == mask) {
3520 r_.u64[i] = UINT64_MAX;
3521 to_do &= ~mask;
3522 }
3523 else r_.u64[i] = 0;
3524
3525 mask = 0xF0;
3526 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3527 r_.u64[i] = a_.u64[i];
3528 to_do &= ~mask;
3529 }
3530
3531 mask = 0xCC;
3532 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3533 r_.u64[i] |= b_.u64[i];
3534 to_do &= ~mask;
3535 }
3536
3537 mask = 0xAA;
3538 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3539 r_.u64[i] |= c_.u64[i];
3540 to_do &= ~mask;
3541 }
3542
3543 mask = 0x0F;
3544 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3545 r_.u64[i] |= ~a_.u64[i];
3546 to_do &= ~mask;
3547 }
3548
3549 mask = 0x33;
3550 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3551 r_.u64[i] |= ~b_.u64[i];
3552 to_do &= ~mask;
3553 }
3554
3555 mask = 0x55;
3556 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3557 r_.u64[i] |= ~c_.u64[i];
3558 to_do &= ~mask;
3559 }
3560
3561 mask = 0x3C;
3562 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3563 r_.u64[i] |= a_.u64[i] ^ b_.u64[i];
3564 to_do &= ~mask;
3565 }
3566
3567 mask = 0x5A;
3568 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3569 r_.u64[i] |= a_.u64[i] ^ c_.u64[i];
3570 to_do &= ~mask;
3571 }
3572
3573 mask = 0x66;
3574 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3575 r_.u64[i] |= b_.u64[i] ^ c_.u64[i];
3576 to_do &= ~mask;
3577 }
3578
3579 mask = 0xA0;
3580 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3581 r_.u64[i] |= a_.u64[i] & c_.u64[i];
3582 to_do &= ~mask;
3583 }
3584
3585 mask = 0x50;
3586 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3587 r_.u64[i] |= ~c_.u64[i] & a_.u64[i];
3588 to_do &= ~mask;
3589 }
3590
3591 mask = 0x0A;
3592 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3593 r_.u64[i] |= ~a_.u64[i] & c_.u64[i];
3594 to_do &= ~mask;
3595 }
3596
3597 mask = 0x88;
3598 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3599 r_.u64[i] |= b_.u64[i] & c_.u64[i];
3600 to_do &= ~mask;
3601 }
3602
3603 mask = 0x44;
3604 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3605 r_.u64[i] |= ~c_.u64[i] & b_.u64[i];
3606 to_do &= ~mask;
3607 }
3608
3609 mask = 0x22;
3610 if ((to_do & mask) && ((imm8 & mask) == mask)) {
3611 r_.u64[i] |= ~b_.u64[i] & c_.u64[i];
3612 to_do &= ~mask;
3613 }
3614
3615 if (to_do & 0xc0) {
3616 t = a_.u64[i] & b_.u64[i];
3617 if ((to_do & 0xc0) == 0xc0) r_.u64[i] |= t;
3618 else if (to_do & 0x80) r_.u64[i] |= c_.u64[i] & t;
3619 else r_.u64[i] |= ~c_.u64[i] & t;
3620 }
3621
3622 if (to_do & 0x30) {
3623 t = ~b_.u64[i] & a_.u64[i];
3624 if ((to_do & 0x30) == 0x30) r_.u64[i] |= t;
3625 else if (to_do & 0x20) r_.u64[i] |= c_.u64[i] & t;
3626 else r_.u64[i] |= ~c_.u64[i] & t;
3627 }
3628
3629 if (to_do & 0x0c) {
3630 t = ~a_.u64[i] & b_.u64[i];
3631 if ((to_do & 0x0c) == 0x0c) r_.u64[i] |= t;
3632 else if (to_do & 0x08) r_.u64[i] |= c_.u64[i] & t;
3633 else r_.u64[i] |= ~c_.u64[i] & t;
3634 }
3635
3636 if (to_do & 0x03) {
3637 t = ~(a_.u64[i] | b_.u64[i]);
3638 if ((to_do & 0x03) == 0x03) r_.u64[i] |= t;
3639 else if (to_do & 0x02) r_.u64[i] |= c_.u64[i] & t;
3640 else r_.u64[i] |= ~c_.u64[i] & t;
3641 }
3642 }
3643 #endif
3644 #else
3645 SIMDE_X_TERNARYLOGIC_SWITCH(imm8 & 255)
3646 #endif
3647
3648 return simde__m512i_from_private(r_);
3649 }
3650 #endif
3651 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3652 #undef _mm512_ternarylogic_epi32
3653 #define _mm512_ternarylogic_epi32(a, b, c, imm8) simde_mm512_ternarylogic_epi32(a, b, c, imm8)
3654 #endif
3655
3656 #if defined(SIMDE_X86_AVX512F_NATIVE)
3657 #define simde_mm512_mask_ternarylogic_epi32(src, k, a, b, imm8) _mm512_mask_ternarylogic_epi32(src, k, a, b, imm8)
3658 #else
3659 #define simde_mm512_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm512_mask_mov_epi32(src, k, simde_mm512_ternarylogic_epi32(src, a, b, imm8))
3660 #endif
3661 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3662 #undef _mm512_mask_ternarylogic_epi32
3663 #define _mm512_mask_ternarylogic_epi32(src, k, a, b, imm8) simde_mm512_mask_ternarylogic_epi32(src, k, a, b, imm8)
3664 #endif
3665
3666 #if defined(SIMDE_X86_AVX512F_NATIVE)
3667 #define simde_mm512_maskz_ternarylogic_epi32(k, a, b, c, imm8) _mm512_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3668 #else
3669 #define simde_mm512_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm512_maskz_mov_epi32(k, simde_mm512_ternarylogic_epi32(a, b, c, imm8))
3670 #endif
3671 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3672 #undef _mm512_maskz_ternarylogic_epi32
3673 #define _mm512_maskz_ternarylogic_epi32(k, a, b, c, imm8) simde_mm512_maskz_ternarylogic_epi32(k, a, b, c, imm8)
3674 #endif
3675
3676 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3677 #define simde_mm_ternarylogic_epi64(a, b, c, imm8) _mm_ternarylogic_epi64(a, b, c, imm8)
3678 #else
3679 #define simde_mm_ternarylogic_epi64(a, b, c, imm8) simde_mm_ternarylogic_epi32(a, b, c, imm8)
3680 #endif
3681 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3682 #undef _mm_ternarylogic_epi64
3683 #define _mm_ternarylogic_epi64(a, b, c, imm8) simde_mm_ternarylogic_epi64(a, b, c, imm8)
3684 #endif
3685
3686 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3687 #define simde_mm_mask_ternarylogic_epi64(src, k, a, b, imm8) _mm_mask_ternarylogic_epi64(src, k, a, b, imm8)
3688 #else
3689 #define simde_mm_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm_mask_mov_epi64(src, k, simde_mm_ternarylogic_epi64(src, a, b, imm8))
3690 #endif
3691 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3692 #undef _mm_mask_ternarylogic_epi64
3693 #define _mm_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm_mask_ternarylogic_epi64(src, k, a, b, imm8)
3694 #endif
3695
3696 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3697 #define simde_mm_maskz_ternarylogic_epi64(k, a, b, c, imm8) _mm_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3698 #else
3699 #define simde_mm_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm_maskz_mov_epi64(k, simde_mm_ternarylogic_epi64(a, b, c, imm8))
3700 #endif
3701 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3702 #undef _mm_maskz_ternarylogic_epi64
3703 #define _mm_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3704 #endif
3705
3706 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3707 #define simde_mm256_ternarylogic_epi64(a, b, c, imm8) _mm256_ternarylogic_epi64(a, b, c, imm8)
3708 #else
3709 #define simde_mm256_ternarylogic_epi64(a, b, c, imm8) simde_mm256_ternarylogic_epi32(a, b, c, imm8)
3710 #endif
3711 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3712 #undef _mm256_ternarylogic_epi64
3713 #define _mm256_ternarylogic_epi64(a, b, c, imm8) simde_mm256_ternarylogic_epi64(a, b, c, imm8)
3714 #endif
3715
3716 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3717 #define simde_mm256_mask_ternarylogic_epi64(src, k, a, b, imm8) _mm256_mask_ternarylogic_epi64(src, k, a, b, imm8)
3718 #else
3719 #define simde_mm256_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm256_mask_mov_epi64(src, k, simde_mm256_ternarylogic_epi64(src, a, b, imm8))
3720 #endif
3721 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3722 #undef _mm256_mask_ternarylogic_epi64
3723 #define _mm256_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm256_mask_ternarylogic_epi64(src, k, a, b, imm8)
3724 #endif
3725
3726 #if defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_X86_AVX512VL_NATIVE)
3727 #define simde_mm256_maskz_ternarylogic_epi64(k, a, b, c, imm8) _mm256_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3728 #else
3729 #define simde_mm256_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm256_maskz_mov_epi64(k, simde_mm256_ternarylogic_epi64(a, b, c, imm8))
3730 #endif
3731 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES) && defined(SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES)
3732 #undef _mm256_maskz_ternarylogic_epi64
3733 #define _mm256_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm256_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3734 #endif
3735
3736 #if defined(SIMDE_X86_AVX512F_NATIVE)
3737 #define simde_mm512_ternarylogic_epi64(a, b, c, imm8) _mm512_ternarylogic_epi64(a, b, c, imm8)
3738 #else
3739 #define simde_mm512_ternarylogic_epi64(a, b, c, imm8) simde_mm512_ternarylogic_epi32(a, b, c, imm8)
3740 #endif
3741 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3742 #undef _mm512_ternarylogic_epi64
3743 #define _mm512_ternarylogic_epi64(a, b, c, imm8) simde_mm512_ternarylogic_epi64(a, b, c, imm8)
3744 #endif
3745
3746 #if defined(SIMDE_X86_AVX512F_NATIVE)
3747 #define simde_mm512_mask_ternarylogic_epi64(src, k, a, b, imm8) _mm512_mask_ternarylogic_epi64(src, k, a, b, imm8)
3748 #else
3749 #define simde_mm512_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm512_mask_mov_epi64(src, k, simde_mm512_ternarylogic_epi64(src, a, b, imm8))
3750 #endif
3751 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3752 #undef _mm512_mask_ternarylogic_epi64
3753 #define _mm512_mask_ternarylogic_epi64(src, k, a, b, imm8) simde_mm512_mask_ternarylogic_epi64(src, k, a, b, imm8)
3754 #endif
3755
3756 #if defined(SIMDE_X86_AVX512F_NATIVE)
3757 #define simde_mm512_maskz_ternarylogic_epi64(k, a, b, c, imm8) _mm512_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3758 #else
3759 #define simde_mm512_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm512_maskz_mov_epi64(k, simde_mm512_ternarylogic_epi64(a, b, c, imm8))
3760 #endif
3761 #if defined(SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES)
3762 #undef _mm512_maskz_ternarylogic_epi64
3763 #define _mm512_maskz_ternarylogic_epi64(k, a, b, c, imm8) simde_mm512_maskz_ternarylogic_epi64(k, a, b, c, imm8)
3764 #endif
3765
3766 SIMDE_END_DECLS_
3767 HEDLEY_DIAGNOSTIC_POP
3768
3769 #endif /* !defined(SIMDE_X86_AVX512_TERNARYLOGIC_H) */