From dc86db5b87945a2bd7a710f1a0a79faff7ccd316 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 28 Dec 2015 10:12:40 -0800 Subject: [PATCH] Reminder to my future self to not over-optimize complex conjugate multiply. --- firmware/common/utility_m4.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/common/utility_m4.hpp b/firmware/common/utility_m4.hpp index e7d98e90f..2516f12a1 100644 --- a/firmware/common/utility_m4.hpp +++ b/firmware/common/utility_m4.hpp @@ -40,6 +40,9 @@ static inline complex32_t multiply_conjugate_s16_s32(const complex16_t::rep_type // multiply: (a + bj) * (c + dj) = (ac - bd) + (bc + ad)j // conjugate-multiply: (ac + bd) + (bc - ad)j //return { a.real() * b.real() + a.imag() * b.imag(), a.imag() * b.real() - a.real() * b.imag() }; + // NOTE: Did not use combination of SMUAD and SMUSDX because of non-saturating arithmetic. + // const int32_t r = __SMUAD(a, b); + // const int32_t i = __SMUSDX(b, a); const int32_t rr = __SMULBB(a, b); const int32_t ii = __SMULTT(a, b); const int32_t r = __QADD(rr, ii);