0
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2026-01-18 17:31:19 +01:00

Fix more bugs in !2052

Fixes #2998

Closes #2998

See merge request libeigen/eigen!2057

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
(cherry picked from commit ed9a0e59ba)
This commit is contained in:
Rasmus Munk Larsen
2025-11-03 20:26:17 +00:00
committed by Antonio Sanchez
parent f7ab506bd0
commit f471ebb8cc
2 changed files with 15 additions and 16 deletions

View File

@@ -281,12 +281,12 @@ EIGEN_STRONG_INLINE Packet2cf pandnot<Packet2cf>(const Packet2cf& a, const Packe
template <>
EIGEN_STRONG_INLINE Packet1cf pload<Packet1cf>(const std::complex<float>* from) {
EIGEN_DEBUG_ALIGNED_LOAD return Packet1cf(
pload<Packet2f>(reinterpret_cast<const float*>(assume_aligned<unpacket_traits<Packet1cf>::alignment>(from))));
pload<Packet2f>(assume_aligned<unpacket_traits<Packet1cf>::alignment>(reinterpret_cast<const float*>(from))));
}
template <>
EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) {
EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(
pload<Packet4f>(reinterpret_cast<const float*>(assume_aligned<unpacket_traits<Packet2cf>::alignment>(from))));
pload<Packet4f>(assume_aligned<unpacket_traits<Packet2cf>::alignment>(reinterpret_cast<const float*>(from))));
}
template <>
@@ -309,12 +309,12 @@ EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* fro
template <>
EIGEN_STRONG_INLINE void pstore<std::complex<float>>(std::complex<float>* to, const Packet1cf& from) {
EIGEN_DEBUG_ALIGNED_STORE pstore(
reinterpret_cast<float*>(assume_aligned<unpacket_traits<Packet1cf>::alignment>(to), from.v));
EIGEN_DEBUG_ALIGNED_STORE pstore(assume_aligned<unpacket_traits<Packet1cf>::alignment>(reinterpret_cast<float*>(to)),
from.v);
}
template <>
EIGEN_STRONG_INLINE void pstore<std::complex<float>>(std::complex<float>* to, const Packet2cf& from) {
EIGEN_DEBUG_ALIGNED_STORE pstore(reinterpret_cast<float*>(assume_aligned<unpacket_traits<Packet2cf>::alignment>(to)),
EIGEN_DEBUG_ALIGNED_STORE pstore(assume_aligned<unpacket_traits<Packet2cf>::alignment>(reinterpret_cast<float*>(to)),
from.v);
}
@@ -532,7 +532,7 @@ struct unpacket_traits<Packet1cd> : neon_unpacket_default<Packet1cd, std::comple
template <>
EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(
pload<Packet2d>(reinterpret_cast<const double*>(assume_aligned<unpacket_traits<Packet1cd>::alignment>(from))));
pload<Packet2d>(assume_aligned<unpacket_traits<Packet1cd>::alignment>(reinterpret_cast<const double*>(from))));
}
template <>
@@ -645,8 +645,8 @@ EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* fr
template <>
EIGEN_STRONG_INLINE void pstore<std::complex<double>>(std::complex<double>* to, const Packet1cd& from) {
EIGEN_DEBUG_ALIGNED_STORE pstore(
reinterpret_cast<double*>(assume_aligned<unpacket_traits<Packet1cd>::alignment>(to), from.v));
EIGEN_DEBUG_ALIGNED_STORE pstore(assume_aligned<unpacket_traits<Packet1cd>::alignment>(reinterpret_cast<double*>(to)),
from.v);
}
template <>

View File

@@ -4707,8 +4707,8 @@ EIGEN_STRONG_INLINE bfloat16 pfirst<Packet4bf>(const Packet4bf& from) {
template <>
EIGEN_STRONG_INLINE Packet4bf pload<Packet4bf>(const bfloat16* from) {
unpacket_traits<Packet4bf>::alignment);
return Packet4bf(pload<Packet4us>(reinterpret_cast<const uint16_t*>(from)));
return Packet4bf(
pload<Packet4us>(reinterpret_cast<const uint16_t*>(assume_aligned<unpacket_traits<Packet4bf>::alignment>(from))));
}
template <>
@@ -5208,8 +5208,7 @@ EIGEN_STRONG_INLINE Packet2d pcmp_eq(const Packet2d& a, const Packet2d& b) {
template <>
EIGEN_STRONG_INLINE Packet2d pload<Packet2d>(const double* from) {
unpacket_traits<Packet2d>::alignment);
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f64(from);
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f64(assume_aligned<unpacket_traits<Packet2d>::alignment>(from));
}
template <>
@@ -5751,14 +5750,14 @@ EIGEN_STRONG_INLINE Packet4hf pandnot<Packet4hf>(const Packet4hf& a, const Packe
template <>
EIGEN_STRONG_INLINE Packet8hf pload<Packet8hf>(const Eigen::half* from) {
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f16(reinterpret_cast<const float16_t*>(
assume_aligned<unpacket_traits<Packet8hf>::alignment>(from)));
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f16(
reinterpret_cast<const float16_t*>(assume_aligned<unpacket_traits<Packet8hf>::alignment>(from)));
}
template <>
EIGEN_STRONG_INLINE Packet4hf pload<Packet4hf>(const Eigen::half* from) {
EIGEN_DEBUG_ALIGNED_LOAD return vld1_f16(reinterpret_cast<const float16_t*>(
assume_aligned<unpacket_traits<Packet4hf>::alignment>(from)));
EIGEN_DEBUG_ALIGNED_LOAD return vld1_f16(
reinterpret_cast<const float16_t*>(assume_aligned<unpacket_traits<Packet4hf>::alignment>(from)));
}
template <>