Reminder to my future self to not over-optimize complex conjugate multiply.

This commit is contained in:
Jared Boone 2015-12-28 10:12:40 -08:00
parent b8726b6ecf
commit dc86db5b87

View File

@ -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);