mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-13 01:59:49 -04:00
Reminder to my future self to not over-optimize complex conjugate multiply.
This commit is contained in:
parent
b8726b6ecf
commit
dc86db5b87
1 changed files with 3 additions and 0 deletions
|
@ -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
|
// multiply: (a + bj) * (c + dj) = (ac - bd) + (bc + ad)j
|
||||||
// conjugate-multiply: (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() };
|
//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 rr = __SMULBB(a, b);
|
||||||
const int32_t ii = __SMULTT(a, b);
|
const int32_t ii = __SMULTT(a, b);
|
||||||
const int32_t r = __QADD(rr, ii);
|
const int32_t r = __QADD(rr, ii);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue