Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -27,21 +27,21 @@
#include <hal.h>
static inline complex32_t multiply_conjugate_s16_s32(const complex16_t::rep_type a, const complex16_t::rep_type b) {
// conjugate: conj(a + bj) = a - bj
// 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);
const int32_t ir = __SMULTB(a, b);
const int32_t ri = __SMULBT(a, b);
const int32_t i = __QSUB(ir, ri);
return { r, i };
// conjugate: conj(a + bj) = a - bj
// 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);
const int32_t ir = __SMULTB(a, b);
const int32_t ri = __SMULBT(a, b);
const int32_t i = __QSUB(ir, ri);
return {r, i};
}
#endif /* defined(LPC43XX_M4) */
#endif/*__UTILITY_M4_H__*/
#endif /*__UTILITY_M4_H__*/