diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-06-30 15:53:06 -0700 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-07-01 23:31:12 +0000 |
commit | 9312a5bf5cd72f45558f402077b0c95683ee0fea (patch) | |
tree | 67ebd169339f5f64dcb58a1e4d334c6affdaec65 /Eigen/src/Core/arch/MSA/Complex.h | |
parent | 6035da5283f12f7e6a49cda0c21696c8e5a115b7 (diff) |
Implement a generic vectorized version of Smith's algorithms for complex division.
Diffstat (limited to 'Eigen/src/Core/arch/MSA/Complex.h')
-rw-r--r-- | Eigen/src/Core/arch/MSA/Complex.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Eigen/src/Core/arch/MSA/Complex.h b/Eigen/src/Core/arch/MSA/Complex.h index 53dacfa43..76e9f7ca0 100644 --- a/Eigen/src/Core/arch/MSA/Complex.h +++ b/Eigen/src/Core/arch/MSA/Complex.h @@ -75,16 +75,13 @@ struct Packet2cf { EIGEN_STRONG_INLINE Packet2cf operator-(const Packet2cf& b) const { return Packet2cf(*this) -= b; } + EIGEN_STRONG_INLINE Packet2cf operator/(const Packet2cf& b) const { + return pdiv_complex(Packet2cf(*this), b); + } EIGEN_STRONG_INLINE Packet2cf& operator/=(const Packet2cf& b) { - *this *= b.conjugate(); - Packet4f s = pmul<Packet4f>(b.v, b.v); - s = padd(s, (Packet4f)__builtin_msa_shf_w((v4i32)s, EIGEN_MSA_SHF_I8(1, 0, 3, 2))); - v = pdiv(v, s); + *this = Packet2cf(*this) / b; return *this; } - EIGEN_STRONG_INLINE Packet2cf operator/(const Packet2cf& b) const { - return Packet2cf(*this) /= b; - } EIGEN_STRONG_INLINE Packet2cf operator-(void) const { return Packet2cf(pnegate(v)); } |