Debian Codegraph @

third-party/simde/arm/neon/mlsl.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_MLSL_H)
28 #define SIMDE_ARM_NEON_MLSL_H
29
30 #include "mull.h"
31 #include "sub.h"
32
33 HEDLEY_DIAGNOSTIC_PUSH
34 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
35 SIMDE_BEGIN_DECLS_
36
37 SIMDE_FUNCTION_ATTRIBUTES
38 simde_int16x8_t
39 simde_vmlsl_s8(simde_int16x8_t a, simde_int8x8_t b, simde_int8x8_t c) {
40 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
41 return vmlsl_s8(a, b, c);
42 #else
43 return simde_vsubq_s16(a, simde_vmull_s8(b, c));
44 #endif
45 }
46 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
47 #undef vmlsl_s8
48 #define vmlsl_s8(a, b, c) simde_vmlsl_s8((a), (b), (c))
49 #endif
50
51 SIMDE_FUNCTION_ATTRIBUTES
52 simde_int32x4_t
53 simde_vmlsl_s16(simde_int32x4_t a, simde_int16x4_t b, simde_int16x4_t c) {
54 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
55 return vmlsl_s16(a, b, c);
56 #else
57 return simde_vsubq_s32(a, simde_vmull_s16(b, c));
58 #endif
59 }
60 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
61 #undef vmlsl_s16
62 #define vmlsl_s16(a, b, c) simde_vmlsl_s16((a), (b), (c))
63 #endif
64
65 SIMDE_FUNCTION_ATTRIBUTES
66 simde_int64x2_t
67 simde_vmlsl_s32(simde_int64x2_t a, simde_int32x2_t b, simde_int32x2_t c) {
68 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
69 return vmlsl_s32(a, b, c);
70 #else
71 return simde_vsubq_s64(a, simde_vmull_s32(b, c));
72 #endif
73 }
74 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
75 #undef vmlsl_s32
76 #define vmlsl_s32(a, b, c) simde_vmlsl_s32((a), (b), (c))
77 #endif
78
79 SIMDE_FUNCTION_ATTRIBUTES
80 simde_uint16x8_t
81 simde_vmlsl_u8(simde_uint16x8_t a, simde_uint8x8_t b, simde_uint8x8_t c) {
82 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
83 return vmlsl_u8(a, b, c);
84 #else
85 return simde_vsubq_u16(a, simde_vmull_u8(b, c));
86 #endif
87 }
88 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
89 #undef vmlsl_u8
90 #define vmlsl_u8(a, b, c) simde_vmlsl_u8((a), (b), (c))
91 #endif
92
93 SIMDE_FUNCTION_ATTRIBUTES
94 simde_uint32x4_t
95 simde_vmlsl_u16(simde_uint32x4_t a, simde_uint16x4_t b, simde_uint16x4_t c) {
96 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
97 return vmlsl_u16(a, b, c);
98 #else
99 return simde_vsubq_u32(a, simde_vmull_u16(b, c));
100 #endif
101 }
102 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
103 #undef vmlsl_u16
104 #define vmlsl_u16(a, b, c) simde_vmlsl_u16((a), (b), (c))
105 #endif
106
107 SIMDE_FUNCTION_ATTRIBUTES
108 simde_uint64x2_t
109 simde_vmlsl_u32(simde_uint64x2_t a, simde_uint32x2_t b, simde_uint32x2_t c) {
110 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
111 return vmlsl_u32(a, b, c);
112 #else
113 return simde_vsubq_u64(a, simde_vmull_u32(b, c));
114 #endif
115 }
116 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
117 #undef vmlsl_u32
118 #define vmlsl_u32(a, b, c) simde_vmlsl_u32((a), (b), (c))
119 #endif
120
121 SIMDE_END_DECLS_
122 HEDLEY_DIAGNOSTIC_POP
123
124 #endif /* !defined(SIMDE_ARM_NEON_MLSL_H) */