added some extra debugging

This commit is contained in:
Konstantinos Margaritis 2017-10-11 10:40:12 -04:00
parent d0b7b9d0d3
commit 380d41fd76
2 changed files with 21 additions and 0 deletions

View File

@ -428,18 +428,28 @@ template<> EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, con
{
Packet4f a_re, a_im, prod, prod_im;
std::cout << "a = " << a.v << std::endl;
std::cout << ", b = " << b.v << std::endl;
// Permute and multiply the real parts of a and b
a_re = vec_perm(a.v, a.v, p16uc_PSET32_WODD);
std::cout << "a_re = " << a_re << std::endl;
// Get the imaginary parts of a
a_im = vec_perm(a.v, a.v, p16uc_PSET32_WEVEN);
std::cout << "a_im = " << a_im << std::endl;
// multiply a_im * b and get the conjugate result
prod_im = a_im * b.v;
std::cout << "prod_im = " << prod_im << std::endl;
prod_im = pxor<Packet4f>(prod_im, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR));
std::cout << "prod_im = " << prod_im << std::endl;
// permute back to a proper order
prod_im = vec_perm(prod_im, prod_im, p16uc_COMPLEX32_REV);
std::cout << "prod_im = " << prod_im << std::endl;
// multiply a_re * b, add prod_im
prod = pmadd<Packet4f>(a_re, b.v, prod_im);
std::cout << "prod = " << prod << std::endl;
return Packet2cf(prod);
}

View File

@ -286,6 +286,17 @@ inline std::ostream & operator <<(std::ostream & s, const Packet2d & v)
return s;
}
#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
inline std::ostream & operator <<(std::ostream & s, const Packet4f & v)
{
Packet vt;
vt.v4f = v;
s << vt.f[0] << ", " << vt.f[1] << ", " << vt.f[2] << ", " << vt.f[3];
return s;
}
#endif
template<int Offset>
struct palign_impl<Offset,Packet4i>
{