mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
ei_pnegate implemented for AltiVec
This commit is contained in:
parent
fbf415c547
commit
fe00e864a1
@ -103,13 +103,14 @@ template<> inline v4i ei_psub(const v4i& a, const v4i& b) { return vec_sub(
|
|||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE v4f ei_pnegate(const v4f& a)
|
template<> EIGEN_STRONG_INLINE v4f ei_pnegate(const v4f& a)
|
||||||
{
|
{
|
||||||
v4i mask(0x80000000,0x80000000,0x80000000,0x80000000);
|
v4i mask = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
|
||||||
return vec_xor(a,(v4f) mask);
|
return vec_xor(a,(v4f) mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE v4i ei_pnegate(const v4i& a)
|
template<> EIGEN_STRONG_INLINE v4i ei_pnegate(const v4i& a)
|
||||||
{
|
{
|
||||||
v4f zero;
|
USE_CONST_v0i;
|
||||||
return ei_psub(vec_xor(zero,zero), a);
|
return ei_psub(v0i, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> inline v4f ei_pmul(const v4f& a, const v4f& b) { USE_CONST_v0f; return vec_madd(a,b, v0f); }
|
template<> inline v4f ei_pmul(const v4f& a, const v4f& b) { USE_CONST_v0f; return vec_madd(a,b, v0f); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user