From f046e326d9e30772725d8fb26dc33328e418d9d3 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Fri, 17 Sep 2021 12:49:01 -0700 Subject: [PATCH] Fix strict aliasing bug causing product_small failure. Packet loading is skipped due to aliasing violation, leading to nullopt matrix multiplication. Fixes #2327. (cherry picked from commit 3c724c44cff3f9e2e9e35351abff0b5c022b320d) --- Eigen/src/Core/arch/AVX/Complex.h | 4 +++- Eigen/src/Core/arch/AVX512/Complex.h | 4 +++- Eigen/src/Core/arch/SSE/Complex.h | 11 +++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Eigen/src/Core/arch/AVX/Complex.h b/Eigen/src/Core/arch/AVX/Complex.h index ab7bd6c65..e9096c0a1 100644 --- a/Eigen/src/Core/arch/AVX/Complex.h +++ b/Eigen/src/Core/arch/AVX/Complex.h @@ -99,7 +99,9 @@ template<> EIGEN_STRONG_INLINE Packet4cf ploadu(const std::complex EIGEN_STRONG_INLINE Packet4cf pset1(const std::complex& from) { - return Packet4cf(_mm256_castpd_ps(_mm256_broadcast_sd((const double*)(const void*)&from))); + const float re = std::real(from); + const float im = std::imag(from); + return Packet4cf(_mm256_set_ps(im, re, im, re, im, re, im, re)); } template<> EIGEN_STRONG_INLINE Packet4cf ploaddup(const std::complex* from) diff --git a/Eigen/src/Core/arch/AVX512/Complex.h b/Eigen/src/Core/arch/AVX512/Complex.h index 49c72b3f1..074253859 100644 --- a/Eigen/src/Core/arch/AVX512/Complex.h +++ b/Eigen/src/Core/arch/AVX512/Complex.h @@ -97,7 +97,9 @@ template<> EIGEN_STRONG_INLINE Packet8cf ploadu(const std::complex EIGEN_STRONG_INLINE Packet8cf pset1(const std::complex& from) { - return Packet8cf(_mm512_castpd_ps(pload1((const double*)(const void*)&from))); + const float re = std::real(from); + const float im = std::imag(from); + return Packet8cf(_mm512_set_ps(im, re, im, re, im, re, im, re, im, re, im, re, im, re, im, re)); } template<> EIGEN_STRONG_INLINE Packet8cf ploaddup(const std::complex* from) diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h index 8fe22da46..215bfd7bb 100644 --- a/Eigen/src/Core/arch/SSE/Complex.h +++ b/Eigen/src/Core/arch/SSE/Complex.h @@ -106,14 +106,9 @@ template<> EIGEN_STRONG_INLINE Packet2cf ploadu(const std::complex EIGEN_STRONG_INLINE Packet2cf pset1(const std::complex& from) { - Packet2cf res; -#ifdef EIGEN_VECTORIZE_SSE3 - res.v = _mm_castpd_ps(_mm_loaddup_pd(reinterpret_cast(&from))); -#else - res.v = _mm_castpd_ps(_mm_load_sd(reinterpret_cast(&from))); - res.v = _mm_movelh_ps(res.v, res.v); -#endif - return res; + const float re = std::real(from); + const float im = std::imag(from); + return Packet2cf(_mm_set_ps(im, re, im, re)); } template<> EIGEN_STRONG_INLINE Packet2cf ploaddup(const std::complex* from) { return pset1(*from); } -- 2.37.0 riables. Efraim Flashner 2023-01-18gnu: Add u-boot-ts7970-q-2g-1000mhz-c-bootloader....* gnu/bootloader/u-boot.scm (u-boot-ts7970-q-2g-1000mhz-c-bootloader): New variable. Maxim Cournoyer 2022-12-28gnu: u-boot-am335x-boneblack: Revert to old name....This reverts to the name this package had previous to commit c2c1dfdf5760873f1db86d14873f725a105f7feb ("gnu: bootloader: Add U-Boot packages for Raspberry Pi models."), which caused the package name to be derived from the board name. * gnu/packages/bootloaders.scm (u-boot-am335x-evm-boneblack): Remove the NAME-SUFFIX keyword argument. Specify the full name via the name field. * gnu/bootloader/u-boot.scm (u-boot-beaglebone-black-bootloader): Adjust to the renamed package. Reported-by: Vagrant Cascadian <vagrant@debian.org> Maxim Cournoyer 2022-12-20gnu: u-boot-am335x-evm-boneblack: Fix variable name....* gnu/packages/bootloaders.scm (u-boot-am335x-boneblack): Rename to... (u-boot-am335x-evm-boneblack), to match the package name. * gnu/bootloader/u-boot.scm (u-boot-beaglebone-black-bootloader): Adjust accordingly. Maxim Cournoyer 2021-05-29gnu: bootloader: Fix install-allwinner64-u-boot....This fixes boot breakage introduced in commit: a65c935e29766940148d52b8116634b1e1cbcba6 Multiple files were still needed, but the filenames changed. * gnu/bootloader/u-boot.scm (install-allwinner64-u-boot): Update to use both SPL and u-boot files with new filenames. Vagrant Cascadian