mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
fix pset1 for complex
This commit is contained in:
parent
0dfea7fce4
commit
23aae0d63e
@ -70,19 +70,17 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<flo
|
|||||||
{
|
{
|
||||||
Packet2cf res;
|
Packet2cf res;
|
||||||
/* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */
|
/* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */
|
||||||
if ((ptrdiff_t)&from % 16 == 0) {
|
if((ptrdiff_t(&from) % 16) == 0)
|
||||||
res.v = pload<Packet4f>((const float *)&from);
|
res.v = pload<Packet4f>((const float *)&from);
|
||||||
res.v = vec_perm(res.v, res.v, p16uc_PSET_HI);
|
else
|
||||||
} else {
|
|
||||||
res.v = ploadu<Packet4f>((const float *)&from);
|
res.v = ploadu<Packet4f>((const float *)&from);
|
||||||
res.v = vec_perm(res.v, res.v, p16uc_PSET_LO);
|
res.v = vec_perm(res.v, res.v, p16uc_PSET_HI);
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_add(a.v,b.v)); }
|
template<> EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_add(a.v,b.v)); }
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_sub(a.v,b.v)); }
|
template<> EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_sub(a.v,b.v)); }
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) { return Packet2cf(psub<Packet4f>(p4f_ZERO, a.v)); }
|
template<> EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) { return Packet2cf(pnegate(a.v)); }
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) { return Packet2cf((Packet4f)vec_xor((Packet4ui)a.v, p4ui_CONJ_XOR)); }
|
template<> EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) { return Packet2cf((Packet4f)vec_xor((Packet4ui)a.v, p4ui_CONJ_XOR)); }
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b)
|
template<> EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user