Debian Codegraph @

third-party/simde/arm/neon/fma_n.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 Evan Nemerson <[email protected]>
25 */
26
27 #if !defined(SIMDE_ARM_NEON_FMA_N_H)
28 #define SIMDE_ARM_NEON_FMA_N_H
29
30 #include "types.h"
31 #include "dup_n.h"
32 #include "fma.h"
33
34 HEDLEY_DIAGNOSTIC_PUSH
35 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
36 SIMDE_BEGIN_DECLS_
37
38 SIMDE_FUNCTION_ATTRIBUTES
39 simde_float32x2_t
40 simde_vfma_n_f32(simde_float32x2_t a, simde_float32x2_t b, simde_float32_t c) {
41 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA) && (!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0)) && !defined(SIMDE_BUG_GCC_95399)
42 return vfma_n_f32(a, b, c);
43 #else
44 return simde_vfma_f32(a, b, simde_vdup_n_f32(c));
45 #endif
46 }
47 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
48 #undef vfma_n_f32
49 #define vfma_n_f32(a, b, c) simde_vfma_n_f32(a, b, c)
50 #endif
51
52 SIMDE_FUNCTION_ATTRIBUTES
53 simde_float64x1_t
54 simde_vfma_n_f64(simde_float64x1_t a, simde_float64x1_t b, simde_float64_t c) {
55 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA) && (!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0))
56 return vfma_n_f64(a, b, c);
57 #else
58 return simde_vfma_f64(a, b, simde_vdup_n_f64(c));
59 #endif
60 }
61 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
62 #undef vfma_n_f64
63 #define vfma_n_f64(a, b, c) simde_vfma_n_f64(a, b, c)
64 #endif
65
66 SIMDE_FUNCTION_ATTRIBUTES
67 simde_float32x4_t
68 simde_vfmaq_n_f32(simde_float32x4_t a, simde_float32x4_t b, simde_float32_t c) {
69 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA) && (!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0)) && !defined(SIMDE_BUG_GCC_95399)
70 return vfmaq_n_f32(a, b, c);
71 #else
72 return simde_vfmaq_f32(a, b, simde_vdupq_n_f32(c));
73 #endif
74 }
75 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
76 #undef vfmaq_n_f32
77 #define vfmaq_n_f32(a, b, c) simde_vfmaq_n_f32(a, b, c)
78 #endif
79
80 SIMDE_FUNCTION_ATTRIBUTES
81 simde_float64x2_t
82 simde_vfmaq_n_f64(simde_float64x2_t a, simde_float64x2_t b, simde_float64_t c) {
83 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA) && (!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0))
84 return vfmaq_n_f64(a, b, c);
85 #else
86 return simde_vfmaq_f64(a, b, simde_vdupq_n_f64(c));
87 #endif
88 }
89 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
90 #undef vfmaq_n_f64
91 #define vfmaq_n_f64(a, b, c) simde_vfmaq_n_f64(a, b, c)
92 #endif
93
94 SIMDE_END_DECLS_
95 HEDLEY_DIAGNOSTIC_POP
96
97 #endif /* !defined(SIMDE_ARM_NEON_CMLA_H) */