18[[gnu::always_inline]]
inline V
fused_lanes(V a, V b, V c,
float sign) {
19 constexpr size_t N =
sizeof(V) /
sizeof(
float);
20 float la[N], lb[N], lc[N];
21 std::memcpy(la, &a,
sizeof(V));
22 std::memcpy(lb, &b,
sizeof(V));
23 std::memcpy(lc, &c,
sizeof(V));
24 for (
size_t i = 0; i < N; ++i)
25 la[i] = std::fma(sign * lb[i], lc[i], la[i]);
27 std::memcpy(&r, la,
sizeof(V));
V fused_lanes(V a, V b, V c, float sign)
a + sign * (b * c) per lane, one rounding; sign is +1 or -1 (negating b * c is exact).
Definition simde_fused.hpp:18
float32x2_t multiply_subtract_fused(float32x2_t a, float32x2_t b, float32x2_t c)
Fused a - (b * c), one rounding.
Definition simde_fused.hpp:36
float32x2_t multiply_add_fused(float32x2_t a, float32x2_t b, float32x2_t c)
Fused a + (b * c), one rounding.
Definition simde_fused.hpp:34
SIMDe's NEON implementation (x86 and other non-Arm hosts) under the NEON intrinsic names.