Debian Codegraph @

third-party/simde/arm/neon/mull_high.h

raw
1 /* SPDX-License-Identifier: MIT
2 *
3 * Permission is hereby granted, free of charge, to any person
4 * obtaining a copy of this software and associated documentation
5 * files (the "Software"), to deal in the Software without
6 * restriction, including without limitation the rights to use, copy,
7 * modify, merge, publish, distribute, sublicense, and/or sell copies
8 * of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Copyright:
24 * 2020 Evan Nemerson <[email protected]>
25 */
26
27 #if !defined(SIMDE_ARM_NEON_MULL_HIGH_H)
28 #define SIMDE_ARM_NEON_MULL_HIGH_H
29
30 #include "types.h"
31 #include "mul.h"
32 #include "movl_high.h"
33
34 HEDLEY_DIAGNOSTIC_PUSH
35 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
36 SIMDE_BEGIN_DECLS_
37
38 SIMDE_FUNCTION_ATTRIBUTES
39 simde_int16x8_t
40 simde_vmull_high_s8(simde_int8x16_t a, simde_int8x16_t b) {
41 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
42 return vmull_high_s8(a, b);
43 #else
44 return simde_vmulq_s16(simde_vmovl_high_s8(a), simde_vmovl_high_s8(b));
45 #endif
46 }
47 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
48 #undef vmull_high_s8
49 #define vmull_high_s8(a, b) simde_vmull_high_s8((a), (b))
50 #endif
51
52 SIMDE_FUNCTION_ATTRIBUTES
53 simde_int32x4_t
54 simde_vmull_high_s16(simde_int16x8_t a, simde_int16x8_t b) {
55 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
56 return vmull_high_s16(a, b);
57 #else
58 return simde_vmulq_s32(simde_vmovl_high_s16(a), simde_vmovl_high_s16(b));
59 #endif
60 }
61 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
62 #undef vmull_high_s16
63 #define vmull_high_s16(a, b) simde_vmull_high_s16((a), (b))
64 #endif
65
66 SIMDE_FUNCTION_ATTRIBUTES
67 simde_int64x2_t
68 simde_vmull_high_s32(simde_int32x4_t a, simde_int32x4_t b) {
69 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
70 return vmull_high_s32(a, b);
71 #else
72 return simde_x_vmulq_s64(simde_vmovl_high_s32(a), simde_vmovl_high_s32(b));
73 #endif
74 }
75 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
76 #undef vmull_high_s32
77 #define vmull_high_s32(a, b) simde_vmull_high_s32((a), (b))
78 #endif
79
80 SIMDE_FUNCTION_ATTRIBUTES
81 simde_uint16x8_t
82 simde_vmull_high_u8(simde_uint8x16_t a, simde_uint8x16_t b) {
83 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
84 return vmull_high_u8(a, b);
85 #else
86 return simde_vmulq_u16(simde_vmovl_high_u8(a), simde_vmovl_high_u8(b));
87 #endif
88 }
89 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
90 #undef vmull_high_u8
91 #define vmull_high_u8(a, b) simde_vmull_high_u8((a), (b))
92 #endif
93
94 SIMDE_FUNCTION_ATTRIBUTES
95 simde_uint32x4_t
96 simde_vmull_high_u16(simde_uint16x8_t a, simde_uint16x8_t b) {
97 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
98 return vmull_high_u16(a, b);
99 #else
100 return simde_vmulq_u32(simde_vmovl_high_u16(a), simde_vmovl_high_u16(b));
101 #endif
102 }
103 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
104 #undef vmull_high_u16
105 #define vmull_high_u16(a, b) simde_vmull_high_u16((a), (b))
106 #endif
107
108 SIMDE_FUNCTION_ATTRIBUTES
109 simde_uint64x2_t
110 simde_vmull_high_u32(simde_uint32x4_t a, simde_uint32x4_t b) {
111 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
112 return vmull_high_u32(a, b);
113 #else
114 return simde_x_vmulq_u64(simde_vmovl_high_u32(a), simde_vmovl_high_u32(b));
115 #endif
116 }
117 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
118 #undef vmull_high_u32
119 #define vmull_high_u32(a, b) simde_vmull_high_u32((a), (b))
120 #endif
121
122 SIMDE_END_DECLS_
123 HEDLEY_DIAGNOSTIC_POP
124
125 #endif /* !defined(SIMDE_ARM_NEON_MULL_HIGH_H) */