Speed up pldexp_generic.

This commit is contained in:
Rasmus Munk Larsen
2024-04-12 01:32:17 +00:00
parent 3c6521ed90
commit 5226566a14
2 changed files with 5 additions and 5 deletions

View File

@@ -1293,13 +1293,13 @@ EIGEN_DEVICE_FUNC inline Packet pmsub(const Packet& a, const Packet& b, const Pa
/** \internal \returns -(a * b) + c (coeff-wise) */
template <typename Packet>
EIGEN_DEVICE_FUNC inline Packet pnmadd(const Packet& a, const Packet& b, const Packet& c) {
return padd(pnegate(pmul(a, b)), c);
return psub(c, pmul(a, b));
}
/** \internal \returns -(a * b) - c (coeff-wise) */
/** \internal \returns -((a * b + c) (coeff-wise) */
template <typename Packet>
EIGEN_DEVICE_FUNC inline Packet pnmsub(const Packet& a, const Packet& b, const Packet& c) {
return psub(pnegate(pmul(a, b)), c);
return pnegate(pmadd(a, b, c));
}
/** \internal copy a packet with constant coefficient \a a (e.g., [a,a,a,a]) to \a *to. \a to must be 16 bytes aligned