Update Eigen to commit:7c7d84735e58b8397922070ec72eca66d6e811c7

CHANGELOG
=========
7c7d84735 - Align temporary array in TensorSelectOp packet evaluator.
142caf889 - Fix MKL enum conversion warning.
9e5714b93 - Remove deprecated CUDA device properties.
06f5cb487 - Use wrapper macro for multidimensional subscript feature test
63fc0bc8c - Make TernarySelectOp immune to const differences.
71703a981 - Make assume_aligned a no-op on ARM & ARM64 when msan is used, to work around a missing linker symbol.
f95b4698f - Add support for C++23 multidimensional subscript operator
b6fcddccf - Get rid of pblend packet op.
ed9a0e59b - Fix more bugs in !2052
a20fc40e4 - Revert "simplify squaredNorm"
04eb06b35 - Fix doc references for nullary expressions.
bfdbc031c - Fixes #2998.
8716f109e - Implement assume_aligned using the standard API
ce70a507c - Enable more generic packet ops for double.
fb5bb3e98 - simplify squaredNorm
ece9a4c0b - Always vectorize abs2() for non-complex types.
60122df69 - Allow user to configure if `free` is allowed at runtime.
923488391 - Fix SparseVector::insert(Index) assigning int to Scalar
be56fff1f - Fix ambiguous sqrt() overload caused by ADL
2e91853ad - Fix a benign bug in ComplexQZ
1a5eecd45 - Clarify range spanning major versions only works with 3.4.1.
b4209fe98 - Eliminate use of std::cout in ArpackSelfAdjointEigenSolver.
ac3ef16f3 - Fix SparseVector::insertBack() with custom scalar types
40da5b64c - CI enhancements: visual indication of flaky tests
8e60d4173 - Support AVX for i686.

PiperOrigin-RevId: 828966695
Change-Id: I3a5adcf24e7c4510e3e8a4106c458456fcae8107
diff --git a/Eigen/src/Core/Assign_MKL.h b/Eigen/src/Core/Assign_MKL.h
index ad11220..7636445 100644
--- a/Eigen/src/Core/Assign_MKL.h
+++ b/Eigen/src/Core/Assign_MKL.h
@@ -56,11 +56,11 @@
                                                    : int(Dst::MaxRowsAtCompileTime),
     MaxSizeAtCompileTime = Dst::SizeAtCompileTime,
 
-    MightEnableVml = StorageOrdersAgree && DstHasDirectAccess && SrcHasDirectAccess &&
+    MightEnableVml = bool(StorageOrdersAgree) && bool(DstHasDirectAccess) && bool(SrcHasDirectAccess) &&
                      Src::InnerStrideAtCompileTime == 1 && Dst::InnerStrideAtCompileTime == 1,
-    MightLinearize = MightEnableVml && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit),
-    VmlSize = MightLinearize ? MaxSizeAtCompileTime : InnerMaxSize,
-    LargeEnough = VmlSize == Dynamic || VmlSize >= EIGEN_MKL_VML_THRESHOLD
+    MightLinearize = bool(MightEnableVml) && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit),
+    VmlSize = bool(MightLinearize) ? MaxSizeAtCompileTime : InnerMaxSize,
+    LargeEnough = (VmlSize == Dynamic) || VmlSize >= EIGEN_MKL_VML_THRESHOLD
   };
 
  public:
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h
index e4c5fed..084f503 100644
--- a/Eigen/src/Core/CwiseNullaryOp.h
+++ b/Eigen/src/Core/CwiseNullaryOp.h
@@ -94,7 +94,7 @@
  * the returned matrix. Must be compatible with this MatrixBase type.
  *
  * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so NullaryExpr(const CustomNullaryOp&) should be used
  * instead.
  *
  * The template parameter \a CustomNullaryOp is the type of the functor.
@@ -121,7 +121,7 @@
  * \only_for_vectors
  *
  * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so Zero() should be used
+ * it is redundant to pass \a size as argument, so NullaryExpr(const CustomNullaryOp&) should be used
  * instead.
  *
  * The template parameter \a CustomNullaryOp is the type of the functor.
@@ -174,7 +174,7 @@
  * the returned matrix. Must be compatible with this DenseBase type.
  *
  * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Constant(const Scalar&) should be used
  * instead.
  *
  * The template parameter \a CustomNullaryOp is the type of the functor.
@@ -195,7 +195,7 @@
  * \only_for_vectors
  *
  * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so Zero() should be used
+ * it is redundant to pass \a size as argument, so Constant(const Scalar&) should be used
  * instead.
  *
  * The template parameter \a CustomNullaryOp is the type of the functor.
diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h
index 377df57..a48fc44 100644
--- a/Eigen/src/Core/DenseCoeffsBase.h
+++ b/Eigen/src/Core/DenseCoeffsBase.h
@@ -113,6 +113,16 @@
     return coeff(row, col);
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  /** \returns the coefficient at given the given row and column.
+   *
+   * \sa operator[](Index,Index), operator[](Index)
+   */
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator[](Index row, Index col) const {
+    return operator()(row, col);
+  }
+#endif
+
   /** Short version: don't use this function, use
    * \link operator[](Index) const \endlink instead.
    *
@@ -316,12 +326,21 @@
    *
    * \sa operator[](Index)
    */
-
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& operator()(Index row, Index col) {
     eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
     return coeffRef(row, col);
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  /** \returns a reference to the coefficient at given the given row and column.
+   *
+   * \sa operator[](Index)
+   */
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& operator[](Index row, Index col) {
+    return operator()(row, col);
+  }
+#endif
+
   /** Short version: don't use this function, use
    * \link operator[](Index) \endlink instead.
    *
diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
index 64e1123..5c8bbce 100644
--- a/Eigen/src/Core/GenericPacketMath.h
+++ b/Eigen/src/Core/GenericPacketMath.h
@@ -63,7 +63,6 @@
 
     HasArg = 0,
     HasAbsDiff = 0,
-    HasBlend = 0,
     // This flag is used to indicate whether packet comparison is supported.
     // pcmp_eq and pcmp_lt should be defined for it to be true.
     HasCmp = 0,
@@ -1482,21 +1481,6 @@
   // Nothing to do in the scalar case, i.e. a 1x1 matrix.
 }
 
-/***************************************************************************
- * Selector, i.e. vector of N boolean values used to select (i.e. blend)
- * words from 2 packets.
- ***************************************************************************/
-template <size_t N>
-struct Selector {
-  bool select[N];
-};
-
-template <typename Packet>
-EIGEN_DEVICE_FUNC inline Packet pblend(const Selector<unpacket_traits<Packet>::size>& ifPacket,
-                                       const Packet& thenPacket, const Packet& elsePacket) {
-  return ifPacket.select[0] ? thenPacket : elsePacket;
-}
-
 /** \internal \returns 1 / a (coeff-wise) */
 template <typename Packet>
 EIGEN_DEVICE_FUNC inline Packet preciprocal(const Packet& a) {
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h
index 27ad78e..66b860a 100644
--- a/Eigen/src/Core/TriangularMatrix.h
+++ b/Eigen/src/Core/TriangularMatrix.h
@@ -89,6 +89,11 @@
     return coeffRef(row, col);
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  EIGEN_DEVICE_FUNC inline Scalar operator[](Index row, Index col) const { return operator()(row, col); }
+  EIGEN_DEVICE_FUNC inline Scalar& operator[](Index row, Index col) { return operator()(row, col); }
+#endif
+
 #ifndef EIGEN_PARSED_BY_DOXYGEN
   EIGEN_DEVICE_FUNC inline const Derived& derived() const { return *static_cast<const Derived*>(this); }
   EIGEN_DEVICE_FUNC inline Derived& derived() { return *static_cast<Derived*>(this); }
diff --git a/Eigen/src/Core/arch/AVX/MathFunctions.h b/Eigen/src/Core/arch/AVX/MathFunctions.h
index 5b7285f..6c40ff9 100644
--- a/Eigen/src/Core/arch/AVX/MathFunctions.h
+++ b/Eigen/src/Core/arch/AVX/MathFunctions.h
@@ -25,8 +25,8 @@
 
 EIGEN_DOUBLE_PACKET_FUNCTION(atanh, Packet4d)
 EIGEN_DOUBLE_PACKET_FUNCTION(log, Packet4d)
-EIGEN_DOUBLE_PACKET_FUNCTION(log2, Packet4d)
 EIGEN_DOUBLE_PACKET_FUNCTION(exp, Packet4d)
+EIGEN_DOUBLE_PACKET_FUNCTION(log2, Packet4d)
 EIGEN_DOUBLE_PACKET_FUNCTION(tanh, Packet4d)
 EIGEN_DOUBLE_PACKET_FUNCTION(cbrt, Packet4d)
 #ifdef EIGEN_VECTORIZE_AVX2
@@ -35,6 +35,8 @@
 #endif
 EIGEN_GENERIC_PACKET_FUNCTION(atan, Packet4d)
 EIGEN_GENERIC_PACKET_FUNCTION(exp2, Packet4d)
+EIGEN_GENERIC_PACKET_FUNCTION(expm1, Packet4d)
+EIGEN_GENERIC_PACKET_FUNCTION(log1p, Packet4d)
 
 // Notice that for newer processors, it is counterproductive to use Newton
 // iteration for square root. In particular, Skylake and Zen2 processors
diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h
index 0cd9e6c..82caebb 100644
--- a/Eigen/src/Core/arch/AVX/PacketMath.h
+++ b/Eigen/src/Core/arch/AVX/PacketMath.h
@@ -115,9 +115,9 @@
     HasATan = 1,
     HasATanh = 1,
     HasLog = 1,
+    HasExp = 1,
     HasLog1p = 1,
     HasExpm1 = 1,
-    HasExp = 1,
     HasPow = 1,
     HasNdtri = 1,
     HasBessel = 1,
@@ -127,7 +127,6 @@
     HasTanh = EIGEN_FAST_MATH,
     HasErf = EIGEN_FAST_MATH,
     HasErfc = EIGEN_FAST_MATH,
-    HasBlend = 1
   };
 };
 template <>
@@ -146,17 +145,18 @@
     HasCos = EIGEN_FAST_MATH,
 #endif
     HasTanh = EIGEN_FAST_MATH,
-    HasLog = 1,
     HasErf = 1,
     HasErfc = 1,
+    HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasPow = 1,
     HasSqrt = 1,
     HasRsqrt = 1,
     HasCbrt = 1,
     HasATan = 1,
     HasATanh = 1,
-    HasBlend = 1
   };
 };
 
@@ -179,7 +179,6 @@
     HasCos = EIGEN_FAST_MATH,
     HasNegate = 1,
     HasAbs = 1,
-    HasAbs2 = 0,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
@@ -192,7 +191,6 @@
     HasRsqrt = 1,
     HasTanh = EIGEN_FAST_MATH,
     HasErf = EIGEN_FAST_MATH,
-    HasBlend = 0,
     HasBessel = 1,
     HasNdtri = 1
   };
@@ -218,7 +216,6 @@
     HasCos = EIGEN_FAST_MATH,
     HasNegate = 1,
     HasAbs = 1,
-    HasAbs2 = 0,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
@@ -231,7 +228,6 @@
     HasRsqrt = 1,
     HasTanh = EIGEN_FAST_MATH,
     HasErf = EIGEN_FAST_MATH,
-    HasBlend = 0,
     HasBessel = 1,
     HasNdtri = 1
   };
@@ -284,7 +280,6 @@
     // HasMin = 0,
     // HasMax = 0,
     HasDiv = 0,
-    HasBlend = 0,
     HasTranspose = 0,
     HasNegate = 0,
     HasSqrt = 0,
@@ -2070,31 +2065,6 @@
   kernel.packet[2] = _mm256_permute2f128_pd(T1, T3, 49);
 }
 
-EIGEN_STRONG_INLINE __m256i avx_blend_mask(const Selector<4>& ifPacket) {
-  return _mm256_set_epi64x(0 - ifPacket.select[3], 0 - ifPacket.select[2], 0 - ifPacket.select[1],
-                           0 - ifPacket.select[0]);
-}
-
-EIGEN_STRONG_INLINE __m256i avx_blend_mask(const Selector<8>& ifPacket) {
-  return _mm256_set_epi32(0 - ifPacket.select[7], 0 - ifPacket.select[6], 0 - ifPacket.select[5],
-                          0 - ifPacket.select[4], 0 - ifPacket.select[3], 0 - ifPacket.select[2],
-                          0 - ifPacket.select[1], 0 - ifPacket.select[0]);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet8f pblend(const Selector<8>& ifPacket, const Packet8f& thenPacket,
-                                    const Packet8f& elsePacket) {
-  const __m256 true_mask = _mm256_castsi256_ps(avx_blend_mask(ifPacket));
-  return pselect<Packet8f>(true_mask, thenPacket, elsePacket);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet4d pblend(const Selector<4>& ifPacket, const Packet4d& thenPacket,
-                                    const Packet4d& elsePacket) {
-  const __m256d true_mask = _mm256_castsi256_pd(avx_blend_mask(ifPacket));
-  return pselect<Packet4d>(true_mask, thenPacket, elsePacket);
-}
-
 // Packet math for Eigen::half
 #ifndef EIGEN_VECTORIZE_AVX512FP16
 template <>
@@ -2831,7 +2801,7 @@
   mask <<= CHAR_BIT * count;
   mask--;
   mask <<= CHAR_BIT * begin;
-#if defined(_WIN32) && !defined(_WIN64)
+#if !EIGEN_ARCH_x86_64
   return _mm_loadl_epi64(reinterpret_cast<const __m128i*>(&mask));
 #else
   return _mm_cvtsi64_si128(mask);
@@ -2847,7 +2817,7 @@
   mask <<= (CHAR_BIT / 2) * count;
   mask--;
   mask <<= CHAR_BIT * begin;
-#if defined(_WIN32) && !defined(_WIN64)
+#if !EIGEN_ARCH_x86_64
   return _mm_loadl_epi64(reinterpret_cast<const __m128i*>(&mask));
 #else
   return _mm_cvtsi64_si128(mask);
diff --git a/Eigen/src/Core/arch/AVX512/PacketMath.h b/Eigen/src/Core/arch/AVX512/PacketMath.h
index b76c8a7..b181053 100644
--- a/Eigen/src/Core/arch/AVX512/PacketMath.h
+++ b/Eigen/src/Core/arch/AVX512/PacketMath.h
@@ -84,7 +84,6 @@
     HasDiv = 1,
     HasNegate = 1,
     HasAbs = 1,
-    HasAbs2 = 0,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
@@ -160,6 +159,8 @@
     HasCos = EIGEN_FAST_MATH,
     HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasPow = 1,
     HasATan = 1,
     HasTanh = EIGEN_FAST_MATH,
@@ -2057,27 +2058,6 @@
   PACK_OUTPUT_I32_2(kernel.packet, tmp.packet, 3, 1);
 }
 
-template <size_t N>
-EIGEN_STRONG_INLINE int avx512_blend_mask(const Selector<N>& ifPacket) {
-  alignas(__m128i) uint8_t aux[sizeof(__m128i)];
-  for (size_t i = 0; i < N; i++) aux[i] = static_cast<uint8_t>(ifPacket.select[i]);
-  __m128i paux = _mm_sub_epi8(_mm_setzero_si128(), _mm_load_si128(reinterpret_cast<const __m128i*>(aux)));
-  return _mm_movemask_epi8(paux);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet16f pblend(const Selector<16>& ifPacket, const Packet16f& thenPacket,
-                                     const Packet16f& elsePacket) {
-  __mmask16 m = avx512_blend_mask(ifPacket);
-  return _mm512_mask_blend_ps(m, elsePacket, thenPacket);
-}
-template <>
-EIGEN_STRONG_INLINE Packet8d pblend(const Selector<8>& ifPacket, const Packet8d& thenPacket,
-                                    const Packet8d& elsePacket) {
-  __mmask8 m = avx512_blend_mask(ifPacket);
-  return _mm512_mask_blend_pd(m, elsePacket, thenPacket);
-}
-
 // Packet math for Eigen::half
 #ifndef EIGEN_VECTORIZE_AVX512FP16
 template <>
diff --git a/Eigen/src/Core/arch/AVX512/PacketMathFP16.h b/Eigen/src/Core/arch/AVX512/PacketMathFP16.h
index a040bbe..b8fa208 100644
--- a/Eigen/src/Core/arch/AVX512/PacketMathFP16.h
+++ b/Eigen/src/Core/arch/AVX512/PacketMathFP16.h
@@ -42,7 +42,6 @@
     HasDiv = 1,

     HasNegate = 1,

     HasAbs = 1,

-    HasAbs2 = 0,

     HasMin = 1,

     HasMax = 1,

     HasConj = 1,

diff --git a/Eigen/src/Core/arch/AltiVec/Complex.h b/Eigen/src/Core/arch/AltiVec/Complex.h
index d6df59a..d49f136 100644
--- a/Eigen/src/Core/arch/AltiVec/Complex.h
+++ b/Eigen/src/Core/arch/AltiVec/Complex.h
@@ -109,9 +109,6 @@
     HasSqrt = 1,
     HasLog = 1,
     HasExp = 1,
-#ifdef EIGEN_VECTORIZE_VSX
-    HasBlend = 1,
-#endif
     HasSetLinear = 0
   };
 };
@@ -364,17 +361,6 @@
   return Packet2cf(vec_and(eq, vec_perm(eq, eq, p16uc_COMPLEX32_REV)));
 }
 
-#ifdef EIGEN_VECTORIZE_VSX
-template <>
-EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
-                                     const Packet2cf& elsePacket) {
-  Packet2cf result;
-  result.v = reinterpret_cast<Packet4f>(
-      pblend<Packet2d>(ifPacket, reinterpret_cast<Packet2d>(thenPacket.v), reinterpret_cast<Packet2d>(elsePacket.v)));
-  return result;
-}
-#endif
-
 template <>
 EIGEN_STRONG_INLINE Packet2cf psqrt<Packet2cf>(const Packet2cf& a) {
   return psqrt_complex<Packet2cf>(a);
diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h
index eefe326..c98f217 100644
--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h
+++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h
@@ -184,6 +184,8 @@
     HasATanh = 1,
     HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
 #ifdef EIGEN_VECTORIZE_VSX
     HasCmp = 1,
     HasPow = 1,
@@ -204,7 +206,6 @@
     HasErf = 0,
 #endif
     HasNegate = 1,
-    HasBlend = 1
   };
 };
 template <>
@@ -241,7 +242,6 @@
     HasTanh = 0,
     HasErf = 0,
     HasNegate = 1,
-    HasBlend = 1
   };
 };
 
@@ -263,7 +263,6 @@
 #else
     HasDiv = 0,
 #endif
-    HasBlend = 1,
     HasCmp = 1
   };
 };
@@ -281,7 +280,6 @@
     HasSub = 1,
     HasMul = 1,
     HasDiv = 0,
-    HasBlend = 1,
     HasCmp = 1
   };
 };
@@ -299,7 +297,6 @@
     HasSub = 1,
     HasMul = 1,
     HasDiv = 0,
-    HasBlend = 1,
     HasCmp = 1
   };
 };
@@ -317,7 +314,6 @@
     HasSub = 1,
     HasMul = 1,
     HasDiv = 0,
-    HasBlend = 1,
     HasCmp = 1
   };
 };
@@ -335,7 +331,6 @@
     HasSub = 1,
     HasMul = 1,
     HasDiv = 0,
-    HasBlend = 1,
     HasCmp = 1
   };
 };
@@ -3053,74 +3048,6 @@
   kernel.packet[15] = vec_mergel(step3[7], step3[15]);
 }
 
-template <typename Packet>
-EIGEN_STRONG_INLINE Packet pblend4(const Selector<4>& ifPacket, const Packet& thenPacket, const Packet& elsePacket) {
-  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
-  Packet4ui mask = reinterpret_cast<Packet4ui>(pnegate(reinterpret_cast<Packet4i>(select)));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet4i pblend(const Selector<4>& ifPacket, const Packet4i& thenPacket,
-                                    const Packet4i& elsePacket) {
-  return pblend4<Packet4i>(ifPacket, thenPacket, elsePacket);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
-                                    const Packet4f& elsePacket) {
-  return pblend4<Packet4f>(ifPacket, thenPacket, elsePacket);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet8s pblend(const Selector<8>& ifPacket, const Packet8s& thenPacket,
-                                    const Packet8s& elsePacket) {
-  Packet8us select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
-                      ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7]};
-  Packet8us mask = reinterpret_cast<Packet8us>(pnegate(reinterpret_cast<Packet8s>(select)));
-  Packet8s result = vec_sel(elsePacket, thenPacket, mask);
-  return result;
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet8us pblend(const Selector<8>& ifPacket, const Packet8us& thenPacket,
-                                     const Packet8us& elsePacket) {
-  Packet8us select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
-                      ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7]};
-  Packet8us mask = reinterpret_cast<Packet8us>(pnegate(reinterpret_cast<Packet8s>(select)));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet8bf pblend(const Selector<8>& ifPacket, const Packet8bf& thenPacket,
-                                     const Packet8bf& elsePacket) {
-  return pblend<Packet8us>(ifPacket, thenPacket, elsePacket);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet16c pblend(const Selector<16>& ifPacket, const Packet16c& thenPacket,
-                                     const Packet16c& elsePacket) {
-  Packet16uc select = {ifPacket.select[0],  ifPacket.select[1],  ifPacket.select[2],  ifPacket.select[3],
-                       ifPacket.select[4],  ifPacket.select[5],  ifPacket.select[6],  ifPacket.select[7],
-                       ifPacket.select[8],  ifPacket.select[9],  ifPacket.select[10], ifPacket.select[11],
-                       ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15]};
-
-  Packet16uc mask = reinterpret_cast<Packet16uc>(pnegate(reinterpret_cast<Packet16c>(select)));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet16uc pblend(const Selector<16>& ifPacket, const Packet16uc& thenPacket,
-                                      const Packet16uc& elsePacket) {
-  Packet16uc select = {ifPacket.select[0],  ifPacket.select[1],  ifPacket.select[2],  ifPacket.select[3],
-                       ifPacket.select[4],  ifPacket.select[5],  ifPacket.select[6],  ifPacket.select[7],
-                       ifPacket.select[8],  ifPacket.select[9],  ifPacket.select[10], ifPacket.select[11],
-                       ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15]};
-
-  Packet16uc mask = reinterpret_cast<Packet16uc>(pnegate(reinterpret_cast<Packet16c>(select)));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
 //---------- double ----------
 #ifdef EIGEN_VECTORIZE_VSX
 typedef __vector double Packet2d;
@@ -3176,9 +3103,11 @@
     HasErfc = EIGEN_FAST_MATH,
     HasATanh = 1,
     HasATan = 0,
-    HasLog = 0,
     HasCmp = 1,
+    HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasSqrt = 1,
     HasCbrt = 1,
 #if !EIGEN_COMP_CLANG
@@ -3187,7 +3116,6 @@
     HasRsqrt = 0,
 #endif
     HasNegate = 1,
-    HasBlend = 1
   };
 };
 
@@ -3713,14 +3641,6 @@
   kernel.packet[1] = t1;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket,
-                                    const Packet2d& elsePacket) {
-  Packet2l select = {ifPacket.select[0], ifPacket.select[1]};
-  Packet2ul mask = reinterpret_cast<Packet2ul>(pnegate(reinterpret_cast<Packet2l>(select)));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
 #endif  // __VSX__
 }  // end namespace internal
 
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h
index 673954e..de30bcb 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h
@@ -210,16 +210,18 @@
   EIGEN_GENERIC_PACKET_FUNCTION(atan, PACKET)
 
 #define EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_DOUBLE(PACKET) \
-  EIGEN_DOUBLE_PACKET_FUNCTION(atanh, PACKET)               \
-  EIGEN_DOUBLE_PACKET_FUNCTION(log, PACKET)                 \
   EIGEN_DOUBLE_PACKET_FUNCTION(sin, PACKET)                 \
   EIGEN_DOUBLE_PACKET_FUNCTION(cos, PACKET)                 \
+  EIGEN_DOUBLE_PACKET_FUNCTION(log, PACKET)                 \
   EIGEN_DOUBLE_PACKET_FUNCTION(log2, PACKET)                \
   EIGEN_DOUBLE_PACKET_FUNCTION(exp, PACKET)                 \
   EIGEN_DOUBLE_PACKET_FUNCTION(tanh, PACKET)                \
+  EIGEN_DOUBLE_PACKET_FUNCTION(atanh, PACKET)               \
   EIGEN_DOUBLE_PACKET_FUNCTION(cbrt, PACKET)                \
-  EIGEN_GENERIC_PACKET_FUNCTION(atan, PACKET)               \
-  EIGEN_GENERIC_PACKET_FUNCTION(exp2, PACKET)
+  EIGEN_GENERIC_PACKET_FUNCTION(expm1, PACKET)              \
+  EIGEN_GENERIC_PACKET_FUNCTION(exp2, PACKET)               \
+  EIGEN_GENERIC_PACKET_FUNCTION(log1p, PACKET)              \
+  EIGEN_GENERIC_PACKET_FUNCTION(atan, PACKET)
 
 }  // end namespace internal
 }  // end namespace Eigen
diff --git a/Eigen/src/Core/arch/HVX/PacketMath.h b/Eigen/src/Core/arch/HVX/PacketMath.h
index 9b6ceb3..36253c5 100644
--- a/Eigen/src/Core/arch/HVX/PacketMath.h
+++ b/Eigen/src/Core/arch/HVX/PacketMath.h
@@ -152,7 +152,6 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 0,
     HasAbsDiff = 0,
     HasMin = 1,
     HasMax = 1,
diff --git a/Eigen/src/Core/arch/LSX/PacketMath.h b/Eigen/src/Core/arch/LSX/PacketMath.h
index 87232aa..77ffdd1 100644
--- a/Eigen/src/Core/arch/LSX/PacketMath.h
+++ b/Eigen/src/Core/arch/LSX/PacketMath.h
@@ -169,10 +169,8 @@
     AlignedOnScalar = 1,
     size = 16,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasCmp = 1,
-    HasBlend = 0
   };
 };
 
@@ -185,11 +183,9 @@
     AlignedOnScalar = 1,
     size = 8,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -202,11 +198,9 @@
     AlignedOnScalar = 1,
     size = 4,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -219,11 +213,9 @@
     AlignedOnScalar = 1,
     size = 2,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -236,11 +228,9 @@
     AlignedOnScalar = 1,
     size = 16,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasNegate = 0,
     HasCmp = 1,
-    HasBlend = 0
   };
 };
 
@@ -253,12 +243,10 @@
     AlignedOnScalar = 1,
     size = 8,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasNegate = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -271,12 +259,10 @@
     AlignedOnScalar = 1,
     size = 4,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasNegate = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -289,12 +275,10 @@
     AlignedOnScalar = 1,
     size = 2,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
     HasNegate = 0,
     HasCmp = 1,
     HasDiv = 1,
-    HasBlend = 0
   };
 };
 
@@ -307,9 +291,7 @@
     AlignedOnScalar = 1,
     size = 4,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
-    HasBlend = 0,
     HasSign = 0,
     HasDiv = 1,
     HasExp = 1,
@@ -328,9 +310,7 @@
     AlignedOnScalar = 1,
     size = 2,
 
-    HasAbs2 = 0,
     HasSetLinear = 0,
-    HasBlend = 0,
     HasSign = 0,
     HasDiv = 1,
     HasSqrt = 1,
diff --git a/Eigen/src/Core/arch/MSA/Complex.h b/Eigen/src/Core/arch/MSA/Complex.h
index 2d2fbbc..fbba642 100644
--- a/Eigen/src/Core/arch/MSA/Complex.h
+++ b/Eigen/src/Core/arch/MSA/Complex.h
@@ -105,7 +105,6 @@
     HasMin = 0,
     HasMax = 0,
     HasSetLinear = 0,
-    HasBlend = 1
   };
 };
 
@@ -314,12 +313,6 @@
   kernel.packet[1].v = tmp;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
-                                     const Packet2cf& elsePacket) {
-  return (Packet2cf)(Packet4f)pblend<Packet2d>(ifPacket, (Packet2d)thenPacket.v, (Packet2d)elsePacket.v);
-}
-
 //---------- double ----------
 
 struct Packet1cd {
diff --git a/Eigen/src/Core/arch/MSA/PacketMath.h b/Eigen/src/Core/arch/MSA/PacketMath.h
index 81da24f..2d5032a 100644
--- a/Eigen/src/Core/arch/MSA/PacketMath.h
+++ b/Eigen/src/Core/arch/MSA/PacketMath.h
@@ -91,7 +91,6 @@
     HasExp = 1,
     HasSqrt = 1,
     HasRsqrt = 1,
-    HasBlend = 1
   };
 };
 
@@ -105,7 +104,6 @@
     size = 4,
     // FIXME check the Has*
     HasDiv = 1,
-    HasBlend = 1
   };
 };
 
@@ -802,22 +800,6 @@
   return v;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
-                                    const Packet4f& elsePacket) {
-  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
-  Packet4i mask = __builtin_msa_ceqi_w((Packet4i)select, 0);
-  return (Packet4f)__builtin_msa_bsel_v((v16u8)mask, (v16u8)thenPacket, (v16u8)elsePacket);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet4i pblend(const Selector<4>& ifPacket, const Packet4i& thenPacket,
-                                    const Packet4i& elsePacket) {
-  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
-  Packet4i mask = __builtin_msa_ceqi_w((Packet4i)select, 0);
-  return (Packet4i)__builtin_msa_bsel_v((v16u8)mask, (v16u8)thenPacket, (v16u8)elsePacket);
-}
-
 //---------- double ----------
 
 typedef v2f64 Packet2d;
@@ -856,7 +838,6 @@
     HasExp = 1,
     HasSqrt = 1,
     HasRsqrt = 1,
-    HasBlend = 1
   };
 };
 
@@ -1222,14 +1203,6 @@
   return v;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket,
-                                    const Packet2d& elsePacket) {
-  Packet2ul select = {ifPacket.select[0], ifPacket.select[1]};
-  Packet2l mask = __builtin_msa_ceqi_d((Packet2l)select, 0);
-  return (Packet2d)__builtin_msa_bsel_v((v16u8)mask, (v16u8)thenPacket, (v16u8)elsePacket);
-}
-
 }  // end namespace internal
 
 }  // end namespace Eigen
diff --git a/Eigen/src/Core/arch/NEON/Complex.h b/Eigen/src/Core/arch/NEON/Complex.h
index f3f6a1a..b8655c8 100644
--- a/Eigen/src/Core/arch/NEON/Complex.h
+++ b/Eigen/src/Core/arch/NEON/Complex.h
@@ -48,7 +48,7 @@
 };
 
 template <>
-struct packet_traits<std::complex<float> > : default_packet_traits {
+struct packet_traits<std::complex<float>> : default_packet_traits {
   typedef Packet2cf type;
   typedef Packet1cf half;
   enum {
@@ -280,13 +280,13 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet1cf pload<Packet1cf>(const std::complex<float>* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet1cf>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cf(pload<Packet2f>((const float*)from));
+  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cf(
+      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_ASSUME_ALIGNED(from, unpacket_traits<Packet2cf>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(pload<Packet4f>(reinterpret_cast<const float*>(from)));
+  EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(
+      pload<Packet4f>(assume_aligned<unpacket_traits<Packet2cf>::alignment>(reinterpret_cast<const float*>(from))));
 }
 
 template <>
@@ -308,22 +308,22 @@
 }
 
 template <>
-EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to, const Packet1cf& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet1cf>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE pstore((float*)to, from.v);
+EIGEN_STRONG_INLINE void pstore<std::complex<float>>(std::complex<float>* to, const Packet1cf& from) {
+  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_ASSUME_ALIGNED(to, unpacket_traits<Packet2cf>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE pstore(reinterpret_cast<float*>(to), from.v);
+EIGEN_STRONG_INLINE void pstore<std::complex<float>>(std::complex<float>* to, const Packet2cf& from) {
+  EIGEN_DEBUG_ALIGNED_STORE pstore(assume_aligned<unpacket_traits<Packet2cf>::alignment>(reinterpret_cast<float*>(to)),
+                                   from.v);
 }
 
 template <>
-EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float>* to, const Packet1cf& from) {
+EIGEN_STRONG_INLINE void pstoreu<std::complex<float>>(std::complex<float>* to, const Packet1cf& from) {
   EIGEN_DEBUG_UNALIGNED_STORE pstoreu((float*)to, from.v);
 }
 template <>
-EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
+EIGEN_STRONG_INLINE void pstoreu<std::complex<float>>(std::complex<float>* to, const Packet2cf& from) {
   EIGEN_DEBUG_UNALIGNED_STORE pstoreu(reinterpret_cast<float*>(to), from.v);
 }
 
@@ -356,7 +356,7 @@
 }
 
 template <>
-EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float>* addr) {
+EIGEN_STRONG_INLINE void prefetch<std::complex<float>>(const std::complex<float>* addr) {
   EIGEN_ARM_PREFETCH(reinterpret_cast<const float*>(addr));
 }
 
@@ -501,7 +501,7 @@
 };
 
 template <>
-struct packet_traits<std::complex<double> > : default_packet_traits {
+struct packet_traits<std::complex<double>> : default_packet_traits {
   typedef Packet1cd type;
   typedef Packet1cd half;
   enum {
@@ -531,8 +531,8 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet1cd>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(pload<Packet2d>(reinterpret_cast<const double*>(from)));
+  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(
+      pload<Packet2d>(assume_aligned<unpacket_traits<Packet1cd>::alignment>(reinterpret_cast<const double*>(from))));
 }
 
 template <>
@@ -644,18 +644,18 @@
 }
 
 template <>
-EIGEN_STRONG_INLINE void pstore<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet1cd>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE pstore(reinterpret_cast<double*>(to), from.v);
+EIGEN_STRONG_INLINE void pstore<std::complex<double>>(std::complex<double>* to, const Packet1cd& from) {
+  EIGEN_DEBUG_ALIGNED_STORE pstore(assume_aligned<unpacket_traits<Packet1cd>::alignment>(reinterpret_cast<double*>(to)),
+                                   from.v);
 }
 
 template <>
-EIGEN_STRONG_INLINE void pstoreu<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
+EIGEN_STRONG_INLINE void pstoreu<std::complex<double>>(std::complex<double>* to, const Packet1cd& from) {
   EIGEN_DEBUG_UNALIGNED_STORE pstoreu(reinterpret_cast<double*>(to), from.v);
 }
 
 template <>
-EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double>* addr) {
+EIGEN_STRONG_INLINE void prefetch<std::complex<double>>(const std::complex<double>* addr) {
   EIGEN_ARM_PREFETCH(reinterpret_cast<const double*>(addr));
 }
 
@@ -677,7 +677,7 @@
 template <>
 EIGEN_STRONG_INLINE std::complex<double> pfirst<Packet1cd>(const Packet1cd& a) {
   EIGEN_ALIGN16 std::complex<double> res;
-  pstore<std::complex<double> >(&res, a);
+  pstore<std::complex<double>>(&res, a);
   return res;
 }
 
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h
index bea50a3..b9d0866 100644
--- a/Eigen/src/Core/arch/NEON/PacketMath.h
+++ b/Eigen/src/Core/arch/NEON/PacketMath.h
@@ -189,13 +189,11 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
     HasDiv = 1,
     HasSin = EIGEN_FAST_MATH,
     HasCos = EIGEN_FAST_MATH,
@@ -205,6 +203,8 @@
     HasATanh = 1,
     HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasPow = 1,
     HasSqrt = 1,
     HasRsqrt = 1,
@@ -235,12 +235,10 @@
     HasAbs = 1,
     HasAbsDiff = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0
   };
 };
 
@@ -262,12 +260,10 @@
     HasAbs = 1,
     HasAbsDiff = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
 
     HasSqrt = 1
   };
@@ -291,12 +287,10 @@
     HasAbs = 1,
     HasAbsDiff = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0
   };
 };
 
@@ -318,12 +312,10 @@
     HasAbs = 1,
     HasAbsDiff = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
     HasSqrt = 1
   };
 };
@@ -345,13 +337,11 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0
   };
 };
 
@@ -372,13 +362,11 @@
     HasNegate = 0,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
 
     HasSqrt = 1
   };
@@ -401,13 +389,11 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0
   };
 };
 
@@ -428,13 +414,11 @@
     HasNegate = 0,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0
   };
 };
 
@@ -2268,13 +2252,11 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet2f pload<Packet2f>(const float* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2f>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_f32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_f32(assume_aligned<unpacket_traits<Packet2f>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4f pload<Packet4f>(const float* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4f>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f32(assume_aligned<unpacket_traits<Packet4f>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4c pload<Packet4c>(const int8_t* from) {
@@ -2284,13 +2266,11 @@
 }
 template <>
 EIGEN_STRONG_INLINE Packet8c pload<Packet8c>(const int8_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8c>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s8(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s8(assume_aligned<unpacket_traits<Packet8c>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet16c pload<Packet16c>(const int8_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet16c>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s8(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s8(assume_aligned<unpacket_traits<Packet16c>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4uc pload<Packet4uc>(const uint8_t* from) {
@@ -2300,63 +2280,51 @@
 }
 template <>
 EIGEN_STRONG_INLINE Packet8uc pload<Packet8uc>(const uint8_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8uc>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u8(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u8(assume_aligned<unpacket_traits<Packet8uc>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet16uc pload<Packet16uc>(const uint8_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet16uc>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u8(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u8(assume_aligned<unpacket_traits<Packet16uc>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4s pload<Packet4s>(const int16_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4s>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s16(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s16(assume_aligned<unpacket_traits<Packet4s>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet8s pload<Packet8s>(const int16_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8s>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s16(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s16(assume_aligned<unpacket_traits<Packet8s>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4us pload<Packet4us>(const uint16_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4us>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u16(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u16(assume_aligned<unpacket_traits<Packet4us>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet8us pload<Packet8us>(const uint16_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8us>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u16(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u16(assume_aligned<unpacket_traits<Packet8us>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet2i pload<Packet2i>(const int32_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2i>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_s32(assume_aligned<unpacket_traits<Packet2i>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4i pload<Packet4i>(const int32_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4i>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s32(assume_aligned<unpacket_traits<Packet4i>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet2ui pload<Packet2ui>(const uint32_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2ui>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_u32(assume_aligned<unpacket_traits<Packet2ui>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet4ui pload<Packet4ui>(const uint32_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4ui>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u32(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u32(assume_aligned<unpacket_traits<Packet4ui>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet2l pload<Packet2l>(const int64_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2l>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s64(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s64(assume_aligned<unpacket_traits<Packet2l>::alignment>(from));
 }
 template <>
 EIGEN_STRONG_INLINE Packet2ul pload<Packet2ul>(const uint64_t* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2ul>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u64(from);
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u64(assume_aligned<unpacket_traits<Packet2ul>::alignment>(from));
 }
 
 template <>
@@ -2580,13 +2548,11 @@
 
 template <>
 EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet2f& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2f>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_f32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_f32(assume_aligned<unpacket_traits<Packet2f>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4f>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_f32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_f32(assume_aligned<unpacket_traits<Packet4f>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet4c& from) {
@@ -2594,13 +2560,11 @@
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet8c& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8c>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_s8(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_s8(assume_aligned<unpacket_traits<Packet8c>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet16c& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet16c>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_s8(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_s8(assume_aligned<unpacket_traits<Packet16c>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet4uc& from) {
@@ -2608,63 +2572,51 @@
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet8uc& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8uc>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_u8(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_u8(assume_aligned<unpacket_traits<Packet8uc>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet16uc& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet16uc>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_u8(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_u8(assume_aligned<unpacket_traits<Packet16uc>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int16_t>(int16_t* to, const Packet4s& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4s>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_s16(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_s16(assume_aligned<unpacket_traits<Packet4s>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int16_t>(int16_t* to, const Packet8s& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8s>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_s16(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_s16(assume_aligned<unpacket_traits<Packet8s>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint16_t>(uint16_t* to, const Packet4us& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4us>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_u16(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_u16(assume_aligned<unpacket_traits<Packet4us>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint16_t>(uint16_t* to, const Packet8us& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8us>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_u16(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_u16(assume_aligned<unpacket_traits<Packet8us>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int32_t>(int32_t* to, const Packet2i& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2i>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_s32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_s32(assume_aligned<unpacket_traits<Packet2i>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int32_t>(int32_t* to, const Packet4i& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4i>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_s32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_s32(assume_aligned<unpacket_traits<Packet4i>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint32_t>(uint32_t* to, const Packet2ui& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2ui>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_u32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_u32(assume_aligned<unpacket_traits<Packet2ui>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint32_t>(uint32_t* to, const Packet4ui& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4ui>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_u32(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_u32(assume_aligned<unpacket_traits<Packet4ui>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<int64_t>(int64_t* to, const Packet2l& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2l>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_s64(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_s64(assume_aligned<unpacket_traits<Packet2l>::alignment>(to), from);
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<uint64_t>(uint64_t* to, const Packet2ul& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2ul>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_u64(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_u64(assume_aligned<unpacket_traits<Packet2ul>::alignment>(to), from);
 }
 
 template <>
@@ -4663,13 +4615,11 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
     HasDiv = 1,
     HasSin = EIGEN_FAST_MATH,
     HasCos = EIGEN_FAST_MATH,
@@ -4739,8 +4689,8 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet4bf pload<Packet4bf>(const bfloat16* from) {
-  EIGEN_ASSUME_ALIGNED(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 <>
@@ -4750,8 +4700,8 @@
 
 template <>
 EIGEN_STRONG_INLINE void pstore<bfloat16>(bfloat16* to, const Packet4bf& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4bf>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_u16(reinterpret_cast<uint16_t*>(to), from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_u16(
+      reinterpret_cast<uint16_t*>(assume_aligned<unpacket_traits<Packet4bf>::alignment>(to)), from);
 }
 
 template <>
@@ -5048,19 +4998,19 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
 
     HasDiv = 1,
 
 #if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG
     HasExp = 1,
     HasLog = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasPow = 1,
     HasATan = 1,
     HasATanh = 1,
@@ -5240,8 +5190,7 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet2d pload<Packet2d>(const double* from) {
-  EIGEN_ASSUME_ALIGNED(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 <>
@@ -5255,8 +5204,7 @@
 }
 template <>
 EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet2d& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2d>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_f64(to, from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_f64(assume_aligned<unpacket_traits<Packet2d>::alignment>(to), from);
 }
 
 template <>
@@ -5424,13 +5372,11 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasAbsDiff = 0,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 1,
-    HasBlend = 0,
     HasInsert = 1,
     HasReduxp = 1,
     HasDiv = 1,
@@ -5784,14 +5730,14 @@
 
 template <>
 EIGEN_STRONG_INLINE Packet8hf pload<Packet8hf>(const Eigen::half* from) {
-  EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8hf>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f16(reinterpret_cast<const float16_t*>(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_ASSUME_ALIGNED(from, unpacket_traits<Packet4hf>::alignment);
-  EIGEN_DEBUG_ALIGNED_LOAD return vld1_f16(reinterpret_cast<const float16_t*>(from));
+  EIGEN_DEBUG_ALIGNED_LOAD return vld1_f16(
+      reinterpret_cast<const float16_t*>(assume_aligned<unpacket_traits<Packet4hf>::alignment>(from)));
 }
 
 template <>
@@ -5866,14 +5812,14 @@
 
 template <>
 EIGEN_STRONG_INLINE void pstore<Eigen::half>(Eigen::half* to, const Packet8hf& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8hf>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1q_f16(reinterpret_cast<float16_t*>(to), from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1q_f16(
+      reinterpret_cast<float16_t*>(assume_aligned<unpacket_traits<Packet8hf>::alignment>(to)), from);
 }
 
 template <>
 EIGEN_STRONG_INLINE void pstore<Eigen::half>(Eigen::half* to, const Packet4hf& from) {
-  EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4hf>::alignment);
-  EIGEN_DEBUG_ALIGNED_STORE vst1_f16(reinterpret_cast<float16_t*>(to), from);
+  EIGEN_DEBUG_ALIGNED_STORE vst1_f16(
+      reinterpret_cast<float16_t*>(assume_aligned<unpacket_traits<Packet4hf>::alignment>(to)), from);
 }
 
 template <>
diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h
index f79da7b..9dfe334 100644
--- a/Eigen/src/Core/arch/SSE/Complex.h
+++ b/Eigen/src/Core/arch/SSE/Complex.h
@@ -49,7 +49,6 @@
     HasMin = 0,
     HasMax = 0,
     HasSetLinear = 0,
-    HasBlend = 1
   };
 };
 #endif
@@ -414,13 +413,6 @@
 }
 
 template <>
-EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
-                                     const Packet2cf& elsePacket) {
-  __m128d result = pblend<Packet2d>(ifPacket, _mm_castps_pd(thenPacket.v), _mm_castps_pd(elsePacket.v));
-  return Packet2cf(_mm_castpd_ps(result));
-}
-
-template <>
 EIGEN_STRONG_INLINE Packet1cd psqrt<Packet1cd>(const Packet1cd& a) {
   return psqrt_complex<Packet1cd>(a);
 }
diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h
index a5e4902..b8b1d9a 100644
--- a/Eigen/src/Core/arch/SSE/PacketMath.h
+++ b/Eigen/src/Core/arch/SSE/PacketMath.h
@@ -218,10 +218,12 @@
     HasSin = EIGEN_FAST_MATH,
     HasCos = EIGEN_FAST_MATH,
     HasTanh = EIGEN_FAST_MATH,
-    HasLog = 1,
     HasErf = EIGEN_FAST_MATH,
     HasErfc = EIGEN_FAST_MATH,
+    HasLog = 1,
     HasExp = 1,
+    HasLog1p = 1,
+    HasExpm1 = 1,
     HasPow = 1,
     HasSqrt = 1,
     HasRsqrt = 1,
@@ -290,7 +292,6 @@
     HasCmp = 1,
     HasShift = 0,
     HasAbs = 0,
-    HasAbs2 = 0,
     HasMin = 0,
     HasMax = 0,
     HasConj = 0,
@@ -1998,44 +1999,6 @@
   kernel.packet[15] = _mm_unpackhi_epi64(u7, uf);
 }
 
-EIGEN_STRONG_INLINE __m128i sse_blend_mask(const Selector<2>& ifPacket) {
-  return _mm_set_epi64x(0 - ifPacket.select[1], 0 - ifPacket.select[0]);
-}
-
-EIGEN_STRONG_INLINE __m128i sse_blend_mask(const Selector<4>& ifPacket) {
-  return _mm_set_epi32(0 - ifPacket.select[3], 0 - ifPacket.select[2], 0 - ifPacket.select[1], 0 - ifPacket.select[0]);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet2l pblend(const Selector<2>& ifPacket, const Packet2l& thenPacket,
-                                    const Packet2l& elsePacket) {
-  const __m128i true_mask = sse_blend_mask(ifPacket);
-  return pselect<Packet2l>(true_mask, thenPacket, elsePacket);
-}
-template <>
-EIGEN_STRONG_INLINE Packet4i pblend(const Selector<4>& ifPacket, const Packet4i& thenPacket,
-                                    const Packet4i& elsePacket) {
-  const __m128i true_mask = sse_blend_mask(ifPacket);
-  return pselect<Packet4i>(true_mask, thenPacket, elsePacket);
-}
-template <>
-EIGEN_STRONG_INLINE Packet4ui pblend(const Selector<4>& ifPacket, const Packet4ui& thenPacket,
-                                     const Packet4ui& elsePacket) {
-  return (Packet4ui)pblend(ifPacket, (Packet4i)thenPacket, (Packet4i)elsePacket);
-}
-template <>
-EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
-                                    const Packet4f& elsePacket) {
-  const __m128i true_mask = sse_blend_mask(ifPacket);
-  return pselect<Packet4f>(_mm_castsi128_ps(true_mask), thenPacket, elsePacket);
-}
-template <>
-EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket,
-                                    const Packet2d& elsePacket) {
-  const __m128i true_mask = sse_blend_mask(ifPacket);
-  return pselect<Packet2d>(_mm_castsi128_pd(true_mask), thenPacket, elsePacket);
-}
-
 // Scalar path for pmadd with FMA to ensure consistency with vectorized path.
 #if defined(EIGEN_VECTORIZE_FMA)
 template <>
@@ -2194,7 +2157,6 @@
     HasDiv    = 1,
     HasNegate = 0,
     HasAbs    = 0,
-    HasAbs2   = 0,
     HasMin    = 0,
     HasMax    = 0,
     HasConj   = 0,
diff --git a/Eigen/src/Core/arch/SVE/PacketMath.h b/Eigen/src/Core/arch/SVE/PacketMath.h
index 6115d1d..28fc62b 100644
--- a/Eigen/src/Core/arch/SVE/PacketMath.h
+++ b/Eigen/src/Core/arch/SVE/PacketMath.h
@@ -49,12 +49,10 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 0,
-    HasBlend = 0,
     HasReduxp = 0  // Not implemented in SVE
   };
 };
@@ -344,12 +342,10 @@
     HasNegate = 1,
     HasAbs = 1,
     HasArg = 0,
-    HasAbs2 = 1,
     HasMin = 1,
     HasMax = 1,
     HasConj = 1,
     HasSetLinear = 0,
-    HasBlend = 0,
     HasReduxp = 0,  // Not implemented in SVE
 
     HasDiv = 1,
diff --git a/Eigen/src/Core/arch/SYCL/PacketMath.h b/Eigen/src/Core/arch/SYCL/PacketMath.h
index 6b6bfe4..e5dad3c 100644
--- a/Eigen/src/Core/arch/SYCL/PacketMath.h
+++ b/Eigen/src/Core/arch/SYCL/PacketMath.h
@@ -542,31 +542,6 @@
   kernel.packet[1].x() = tmp;
 }
 
-template <>
-EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_half8 pblend(
-    const Selector<unpacket_traits<cl::sycl::cl_half8>::size>& ifPacket, const cl::sycl::cl_half8& thenPacket,
-    const cl::sycl::cl_half8& elsePacket) {
-  cl::sycl::cl_short8 condition(ifPacket.select[0] ? 0 : -1, ifPacket.select[1] ? 0 : -1, ifPacket.select[2] ? 0 : -1,
-                                ifPacket.select[3] ? 0 : -1, ifPacket.select[4] ? 0 : -1, ifPacket.select[5] ? 0 : -1,
-                                ifPacket.select[6] ? 0 : -1, ifPacket.select[7] ? 0 : -1);
-  return cl::sycl::select(thenPacket, elsePacket, condition);
-}
-
-template <>
-EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_float4 pblend(
-    const Selector<unpacket_traits<cl::sycl::cl_float4>::size>& ifPacket, const cl::sycl::cl_float4& thenPacket,
-    const cl::sycl::cl_float4& elsePacket) {
-  cl::sycl::cl_int4 condition(ifPacket.select[0] ? 0 : -1, ifPacket.select[1] ? 0 : -1, ifPacket.select[2] ? 0 : -1,
-                              ifPacket.select[3] ? 0 : -1);
-  return cl::sycl::select(thenPacket, elsePacket, condition);
-}
-
-template <>
-inline cl::sycl::cl_double2 pblend(const Selector<unpacket_traits<cl::sycl::cl_double2>::size>& ifPacket,
-                                   const cl::sycl::cl_double2& thenPacket, const cl::sycl::cl_double2& elsePacket) {
-  cl::sycl::cl_long2 condition(ifPacket.select[0] ? 0 : -1, ifPacket.select[1] ? 0 : -1);
-  return cl::sycl::select(thenPacket, elsePacket, condition);
-}
 #endif  // SYCL_DEVICE_ONLY
 
 }  // end namespace internal
diff --git a/Eigen/src/Core/arch/ZVector/Complex.h b/Eigen/src/Core/arch/ZVector/Complex.h
index 692f90f..dfcdcab 100644
--- a/Eigen/src/Core/arch/ZVector/Complex.h
+++ b/Eigen/src/Core/arch/ZVector/Complex.h
@@ -72,7 +72,6 @@
     HasAbs2 = 0,
     HasMin = 0,
     HasMax = 0,
-    HasBlend = 1,
     HasSetLinear = 0
   };
 };
@@ -469,14 +468,6 @@
   kernel.packet[1].cd[0] = tmp;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
-                                     const Packet2cf& elsePacket) {
-  Packet2cf result;
-  const Selector<4> ifPacket4 = {ifPacket.select[0], ifPacket.select[0], ifPacket.select[1], ifPacket.select[1]};
-  result.v = pblend<Packet4f>(ifPacket4, thenPacket.v, elsePacket.v);
-  return result;
-}
 #else
 template <>
 EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf& a, const Packet2cf& b) {
@@ -553,14 +544,6 @@
   kernel.packet[0].v = tmp;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
-                                     const Packet2cf& elsePacket) {
-  Packet2cf result;
-  result.v = reinterpret_cast<Packet4f>(
-      pblend<Packet2d>(ifPacket, reinterpret_cast<Packet2d>(thenPacket.v), reinterpret_cast<Packet2d>(elsePacket.v)));
-  return result;
-}
 #endif
 
 }  // end namespace internal
diff --git a/Eigen/src/Core/arch/ZVector/PacketMath.h b/Eigen/src/Core/arch/ZVector/PacketMath.h
index 39073ed..4ccda87 100644
--- a/Eigen/src/Core/arch/ZVector/PacketMath.h
+++ b/Eigen/src/Core/arch/ZVector/PacketMath.h
@@ -167,7 +167,6 @@
     HasSub = 1,
     HasMul = 1,
     HasDiv = 1,
-    HasBlend = 1
   };
 };
 
@@ -197,7 +196,6 @@
     HasTanh = 1,
     HasErf = 1,
     HasNegate = 1,
-    HasBlend = 1
   };
 };
 
@@ -224,7 +222,6 @@
     HasSqrt = 1,
     HasRsqrt = 1,
     HasNegate = 1,
-    HasBlend = 1
   };
 };
 
@@ -594,41 +591,32 @@
 
 template <int N>
 EIGEN_STRONG_INLINE Packet2l parithmetic_shift_right(const Packet2l& a) {
-  return Packet2l { parithmetic_shift_right<N>(a[0]), parithmetic_shift_right<N>(a[1]) };
+  return Packet2l{parithmetic_shift_right<N>(a[0]), parithmetic_shift_right<N>(a[1])};
 }
 template <int N>
 EIGEN_STRONG_INLINE Packet4i parithmetic_shift_right(const Packet4i& a) {
-  return Packet4i {
-    parithmetic_shift_right<N>(a[0]),
-    parithmetic_shift_right<N>(a[1]),
-    parithmetic_shift_right<N>(a[2]),
-    parithmetic_shift_right<N>(a[3]) };
+  return Packet4i{parithmetic_shift_right<N>(a[0]), parithmetic_shift_right<N>(a[1]), parithmetic_shift_right<N>(a[2]),
+                  parithmetic_shift_right<N>(a[3])};
 }
 
 template <int N>
 EIGEN_STRONG_INLINE Packet2l plogical_shift_right(const Packet2l& a) {
-  return Packet2l { plogical_shift_right<N>(a[0]), plogical_shift_right<N>(a[1]) };
+  return Packet2l{plogical_shift_right<N>(a[0]), plogical_shift_right<N>(a[1])};
 }
 template <int N>
 EIGEN_STRONG_INLINE Packet4i plogical_shift_right(const Packet4i& a) {
-  return Packet4i {
-    plogical_shift_right<N>(a[0]),
-    plogical_shift_right<N>(a[1]),
-    plogical_shift_right<N>(a[2]),
-    plogical_shift_right<N>(a[3]) };
+  return Packet4i{plogical_shift_right<N>(a[0]), plogical_shift_right<N>(a[1]), plogical_shift_right<N>(a[2]),
+                  plogical_shift_right<N>(a[3])};
 }
 
 template <int N>
 EIGEN_STRONG_INLINE Packet2l plogical_shift_left(const Packet2l& a) {
-  return Packet2l { plogical_shift_left<N>(a[0]), plogical_shift_left<N>(a[1]) };
+  return Packet2l{plogical_shift_left<N>(a[0]), plogical_shift_left<N>(a[1])};
 }
 template <int N>
 EIGEN_STRONG_INLINE Packet4i plogical_shift_left(const Packet4i& a) {
-  return Packet4i {
-    plogical_shift_left<N>(a[0]),
-    plogical_shift_left<N>(a[1]),
-    plogical_shift_left<N>(a[2]),
-    plogical_shift_left<N>(a[3]) };
+  return Packet4i{plogical_shift_left<N>(a[0]), plogical_shift_left<N>(a[1]), plogical_shift_left<N>(a[2]),
+                  plogical_shift_left<N>(a[3])};
 }
 
 template <>
@@ -747,22 +735,6 @@
   kernel.packet[1] = t1;
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet4i pblend(const Selector<4>& ifPacket, const Packet4i& thenPacket,
-                                    const Packet4i& elsePacket) {
-  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
-  Packet4ui mask = vec_cmpeq(select, reinterpret_cast<Packet4ui>(p4i_ONE));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
-template <>
-EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket,
-                                    const Packet2d& elsePacket) {
-  Packet2ul select = {ifPacket.select[0], ifPacket.select[1]};
-  Packet2ul mask = vec_cmpeq(select, reinterpret_cast<Packet2ul>(p2l_ONE));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
 /* z13 has no vector float support so we emulate that with double
    z14 has proper vector float support.
 */
@@ -1069,19 +1041,6 @@
 }
 
 template <>
-EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
-                                    const Packet4f& elsePacket) {
-  Packet2ul select_hi = {ifPacket.select[0], ifPacket.select[1]};
-  Packet2ul select_lo = {ifPacket.select[2], ifPacket.select[3]};
-  Packet2ul mask_hi = vec_cmpeq(select_hi, reinterpret_cast<Packet2ul>(p2l_ONE));
-  Packet2ul mask_lo = vec_cmpeq(select_lo, reinterpret_cast<Packet2ul>(p2l_ONE));
-  Packet4f result;
-  result.v4f[0] = vec_sel(elsePacket.v4f[0], thenPacket.v4f[0], mask_hi);
-  result.v4f[1] = vec_sel(elsePacket.v4f[1], thenPacket.v4f[1], mask_lo);
-  return result;
-}
-
-template <>
 Packet4f EIGEN_STRONG_INLINE pcmp_le<Packet4f>(const Packet4f& a, const Packet4f& b) {
   Packet4f res;
   res.v4f[0] = pcmp_le(a.v4f[0], b.v4f[0]);
@@ -1288,14 +1247,6 @@
   kernel.packet[3] = vec_mergel(t1, t3);
 }
 
-template <>
-EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
-                                    const Packet4f& elsePacket) {
-  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
-  Packet4ui mask = vec_cmpeq(select, reinterpret_cast<Packet4ui>(p4i_ONE));
-  return vec_sel(elsePacket, thenPacket, mask);
-}
-
 #endif
 
 template <>
@@ -1338,62 +1289,51 @@
 }
 
 #if !defined(vec_float) || !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 13)
-#pragma GCC warning \
-    "float->int and int->float conversion is simulated. compile for z15 for improved performance"
+#pragma GCC warning "float->int and int->float conversion is simulated. compile for z15 for improved performance"
 template <>
 struct cast_impl<Packet4i, Packet4f> {
   EIGEN_DEVICE_FUNC static inline Packet4f run(const Packet4i& a) {
-    return Packet4f{float(a[0]), float(a[1]), float(a[2]), float(a[3]) };
+    return Packet4f{float(a[0]), float(a[1]), float(a[2]), float(a[3])};
   }
 };
 
 template <>
 struct cast_impl<Packet4f, Packet4i> {
   EIGEN_DEVICE_FUNC static inline Packet4i run(const Packet4f& a) {
-    return Packet4i{int(a[0]), int(a[1]), int(a[2]), int(a[3]) };
+    return Packet4i{int(a[0]), int(a[1]), int(a[2]), int(a[3])};
   }
 };
 
 template <>
 struct cast_impl<Packet2l, Packet2d> {
-  EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) {
-    return Packet2d{double(a[0]), double(a[1]) };
-  }
+  EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) { return Packet2d{double(a[0]), double(a[1])}; }
 };
 
 template <>
 struct cast_impl<Packet2d, Packet2l> {
   EIGEN_DEVICE_FUNC static inline Packet2l run(const Packet2d& a) {
-    return Packet2l{(long long)(a[0]), (long long)(a[1]) };
+    return Packet2l{(long long)(a[0]), (long long)(a[1])};
   }
 };
 #else
 template <>
 struct cast_impl<Packet4i, Packet4f> {
-  EIGEN_DEVICE_FUNC static inline Packet4f run(const Packet4i& a) {
-    return vec_float(a);
-  }
+  EIGEN_DEVICE_FUNC static inline Packet4f run(const Packet4i& a) { return vec_float(a); }
 };
 
 template <>
 struct cast_impl<Packet4f, Packet4i> {
-  EIGEN_DEVICE_FUNC static inline Packet4i run(const Packet4f& a) {
-    return vec_signed(a);
-  }
+  EIGEN_DEVICE_FUNC static inline Packet4i run(const Packet4f& a) { return vec_signed(a); }
 };
 
 template <>
 struct cast_impl<Packet2l, Packet2d> {
-  EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) {
-    return vec_double(a);
-  }
+  EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) { return vec_double(a); }
 };
 
 template <>
 struct cast_impl<Packet2d, Packet2l> {
-  EIGEN_DEVICE_FUNC static inline Packet2l run(const Packet2d& a) {
-    return vec_signed(a);
-  }
+  EIGEN_DEVICE_FUNC static inline Packet2l run(const Packet2d& a) { return vec_signed(a); }
 };
 #endif
 
diff --git a/Eigen/src/Core/functors/TernaryFunctors.h b/Eigen/src/Core/functors/TernaryFunctors.h
index 745779a..82095f1 100644
--- a/Eigen/src/Core/functors/TernaryFunctors.h
+++ b/Eigen/src/Core/functors/TernaryFunctors.h
@@ -21,7 +21,8 @@
 
 template <typename ThenScalar, typename ElseScalar, typename ConditionScalar>
 struct scalar_boolean_select_op {
-  static constexpr bool ThenElseAreSame = is_same<ThenScalar, ElseScalar>::value;
+  static constexpr bool ThenElseAreSame =
+      is_same<std::remove_const_t<ThenScalar>, std::remove_const_t<ElseScalar>>::value;
   EIGEN_STATIC_ASSERT(ThenElseAreSame, THEN AND ELSE MUST BE SAME TYPE)
   using Scalar = ThenScalar;
   using result_type = Scalar;
diff --git a/Eigen/src/Core/functors/UnaryFunctors.h b/Eigen/src/Core/functors/UnaryFunctors.h
index ba7d97a..202995f 100644
--- a/Eigen/src/Core/functors/UnaryFunctors.h
+++ b/Eigen/src/Core/functors/UnaryFunctors.h
@@ -100,7 +100,10 @@
 };
 template <typename Scalar>
 struct functor_traits<scalar_abs2_op<Scalar>> {
-  enum { Cost = NumTraits<Scalar>::MulCost, PacketAccess = packet_traits<Scalar>::HasAbs2 };
+  enum {
+    Cost = NumTraits<Scalar>::MulCost,
+    PacketAccess = packet_traits<Scalar>::HasMul && !NumTraits<Scalar>::IsComplex
+  };
 };
 
 template <typename Scalar, bool IsComplex = NumTraits<Scalar>::IsComplex>
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 51a32a9..470622c 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -834,6 +834,11 @@
 #endif
 #endif
 
+// Multidimensional subscript operator feature test
+#if defined(__cpp_multidimensional_subscript) && __cpp_multidimensional_subscript >= 202110L
+#define EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+#endif
+
 //------------------------------------------------------------------------------------------
 // Preprocessor programming helpers
 //------------------------------------------------------------------------------------------
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index d1f2bf3..1492f72 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -91,6 +91,9 @@
 EIGEN_DEVICE_FUNC inline void check_that_malloc_is_allowed() {
   eigen_assert(false && "heap allocation is forbidden (EIGEN_NO_MALLOC is defined)");
 }
+EIGEN_DEVICE_FUNC inline void check_that_free_is_allowed() {
+  eigen_assert(false && "heap deallocation is forbidden (EIGEN_NO_MALLOC is defined)");
+}
 #elif defined EIGEN_RUNTIME_NO_MALLOC
 EIGEN_DEVICE_FUNC inline bool is_malloc_allowed_impl(bool update, bool new_value = false) {
   EIGEN_MALLOC_CHECK_THREAD_LOCAL static bool value = true;
@@ -101,10 +104,22 @@
 EIGEN_DEVICE_FUNC inline bool set_is_malloc_allowed(bool new_value) { return is_malloc_allowed_impl(true, new_value); }
 EIGEN_DEVICE_FUNC inline void check_that_malloc_is_allowed() {
   eigen_assert(is_malloc_allowed() &&
-               "heap allocation is forbidden (EIGEN_RUNTIME_NO_MALLOC is defined and g_is_malloc_allowed is false)");
+               "heap allocation is forbidden (EIGEN_RUNTIME_NO_MALLOC is defined and set_is_malloc_allowed is false)");
+}
+EIGEN_DEVICE_FUNC inline bool is_free_allowed_impl(bool update, bool new_value = false) {
+  EIGEN_MALLOC_CHECK_THREAD_LOCAL static bool value = true;
+  if (update == 1) value = new_value;
+  return value;
+}
+EIGEN_DEVICE_FUNC inline bool is_free_allowed() { return is_free_allowed_impl(false); }
+EIGEN_DEVICE_FUNC inline bool set_is_free_allowed(bool new_value) { return is_free_allowed_impl(true, new_value); }
+EIGEN_DEVICE_FUNC inline void check_that_free_is_allowed() {
+  eigen_assert(is_malloc_allowed() &&
+               "heap deallocation is forbidden (EIGEN_RUNTIME_NO_MALLOC is defined and set_is_free_allowed is false)");
 }
 #else
 EIGEN_DEVICE_FUNC inline void check_that_malloc_is_allowed() {}
+EIGEN_DEVICE_FUNC inline void check_that_free_is_allowed() {}
 #endif
 
 EIGEN_DEVICE_FUNC inline void throw_std_bad_alloc() {
@@ -161,7 +176,7 @@
     std::size_t offset = static_cast<std::size_t>(*(static_cast<uint8_t*>(ptr) - 1)) + 1;
     void* original = static_cast<void*>(static_cast<uint8_t*>(ptr) - offset);
 
-    check_that_malloc_is_allowed();
+    check_that_free_is_allowed();
     EIGEN_USING_STD(free)
     free(original);
   }
@@ -227,7 +242,7 @@
 #if (EIGEN_DEFAULT_ALIGN_BYTES == 0) || EIGEN_MALLOC_ALREADY_ALIGNED
 
   if (ptr != nullptr) {
-    check_that_malloc_is_allowed();
+    check_that_free_is_allowed();
     EIGEN_USING_STD(free)
     free(ptr);
   }
@@ -299,7 +314,7 @@
 template <>
 EIGEN_DEVICE_FUNC inline void conditional_aligned_free<false>(void* ptr) {
   if (ptr != nullptr) {
-    check_that_malloc_is_allowed();
+    check_that_free_is_allowed();
     EIGEN_USING_STD(free)
     free(ptr);
   }
@@ -1339,19 +1354,28 @@
 }
 #endif
 
-/** \internal
- * This informs the implementation that PTR is aligned to at least ALIGN_BYTES
- */
-#ifndef EIGEN_ASSUME_ALIGNED
-#if defined(__cpp_lib_assume_aligned) && (__cpp_lib_assume_aligned >= 201811L)
-#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) \
-  { PTR = std::assume_aligned<ALIGN_BYTES>(PTR); }
-#elif EIGEN_HAS_BUILTIN(__builtin_assume_aligned)
-#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) \
-  { PTR = static_cast<decltype(PTR)>(__builtin_assume_aligned(PTR, ALIGN_BYTES)); }
-#else
-#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) /* do nothing */
+// FIXME(rmlarsen): Work around missing linker symbol with msan on ARM.
+#if !defined(EIGEN_DONT_ASSUME_ALIGNED) && __has_feature(memory_sanitizer) && \
+    (EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64)
+#define EIGEN_DONT_ASSUME_ALIGNED
 #endif
+
+
+#if !defined(EIGEN_DONT_ASSUME_ALIGNED) && defined(__cpp_lib_assume_aligned) && (__cpp_lib_assume_aligned >= 201811L)
+template <std::size_t N, typename T>
+EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) {
+  return std::assume_aligned<N, T>(ptr);
+}
+#elif !defined(EIGEN_DONT_ASSUME_ALIGNED) && EIGEN_HAS_BUILTIN(__builtin_assume_aligned)
+template <std::size_t N, typename T>
+EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC T* assume_aligned(T* ptr) {
+  return static_cast<T*>(__builtin_assume_aligned(ptr, N));
+}
+#else
+template <std::size_t N, typename T>
+EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) {
+  return ptr;
+}
 #endif
 
 }  // end namespace internal
diff --git a/Eigen/src/Eigenvalues/ComplexQZ.h b/Eigen/src/Eigenvalues/ComplexQZ.h
index de35698..ed32ea3 100644
--- a/Eigen/src/Eigenvalues/ComplexQZ.h
+++ b/Eigen/src/Eigenvalues/ComplexQZ.h
@@ -565,7 +565,9 @@
   for (Index j = k + 1; j <= l; j++) {
     // Create a 0 at _T(j, j)
     J.makeGivens(m_T(j - 1, j), m_T(j, j), &m_T.coeffRef(j - 1, j));
-    m_T.rightCols(m_n - j - 1).applyOnTheLeft(j - 1, j, J.adjoint());
+    if (m_n - j - 1 > 0) {
+      m_T.rightCols(m_n - j - 1).applyOnTheLeft(j - 1, j, J.adjoint());
+    }
     m_T.coeffRef(j, j) = Scalar(0);
 
     m_S.applyOnTheLeft(j - 1, j, J.adjoint());
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index a5d7b60..bb8ba4c 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -365,6 +365,15 @@
    * \sa MatrixBase::operator(Index,Index) */
   EIGEN_DEVICE_FUNC inline Scalar& operator()(Index row, Index col) { return m_matrix(row, col); }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  /** shortcut for m_matrix(row,col);
+   * \sa MatrixBase::operator(Index,Index) const */
+  EIGEN_DEVICE_FUNC inline Scalar operator[](Index row, Index col) const { return m_matrix[row, col]; }
+  /** shortcut for m_matrix(row,col);
+   * \sa MatrixBase::operator(Index,Index) */
+  EIGEN_DEVICE_FUNC inline Scalar& operator[](Index row, Index col) { return m_matrix[row, col]; }
+#endif
+
   /** \returns a read-only expression of the transformation matrix */
   EIGEN_DEVICE_FUNC inline const MatrixType& matrix() const { return m_matrix; }
   /** \returns a writable expression of the transformation matrix */
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index 96b1daf..e5d2d4f 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -65,7 +65,6 @@
 EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essential, Scalar& tau,
                                                             RealScalar& beta) const {
   using numext::conj;
-  using numext::sqrt;
 
   EIGEN_STATIC_ASSERT_VECTOR_ONLY(EssentialPart)
   VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size() - 1);
@@ -79,7 +78,7 @@
     beta = numext::real(c0);
     essential.setZero();
   } else {
-    beta = sqrt(numext::abs2(c0) + tailSqNorm);
+    beta = numext::sqrt(numext::abs2(c0) + tailSqNorm);
     if (numext::real(c0) >= RealScalar(0)) beta = -beta;
     essential = tail / (c0 - beta);
     tau = conj((beta - c0) / beta);
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index d19a00d..c8d34e3 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -140,7 +140,7 @@
     return insertBack(inner);
   }
   inline Scalar& insertBack(Index i) {
-    m_data.append(0, i);
+    m_data.append(Scalar(0), i);
     return m_data.value(m_data.size() - 1);
   }
 
@@ -150,7 +150,7 @@
     return insertBackUnordered(inner);
   }
   inline Scalar& insertBackUnordered(Index i) {
-    m_data.append(0, i);
+    m_data.append(Scalar(0), i);
     return m_data.value(m_data.size() - 1);
   }
 
@@ -177,7 +177,7 @@
       --p;
     }
     m_data.index(p + 1) = convert_index(i);
-    m_data.value(p + 1) = 0;
+    m_data.value(p + 1) = Scalar(0);
     return m_data.value(p + 1);
   }
 
@@ -367,7 +367,7 @@
 
   /** \internal \deprecated use insertBack(Index) */
   EIGEN_DEPRECATED_WITH_REASON("Use .insertBack() instead.") Scalar& fill(Index i) {
-    m_data.append(0, i);
+    m_data.append(Scalar(0), i);
     return m_data.value(m_data.size() - 1);
   }
 
diff --git a/cmake/EigenSmokeTestList.cmake b/cmake/EigenSmokeTestList.cmake
index db7d3ff..247b2c4 100644
--- a/cmake/EigenSmokeTestList.cmake
+++ b/cmake/EigenSmokeTestList.cmake
@@ -91,7 +91,7 @@
   qr_1
   qr_colpivoting_7
   qr_fullpivoting_4
-  rand
+  rand_1
   real_qz_1
   redux_1
   ref_1
diff --git a/doc/TopicCMakeGuide.dox b/doc/TopicCMakeGuide.dox
index ebbc4a8..dc0d706 100644
--- a/doc/TopicCMakeGuide.dox
+++ b/doc/TopicCMakeGuide.dox
@@ -36,9 +36,9 @@
 ```
 find_package(Eigen3 3.4 REQUIRED NO_MODULE)  # Restricts to 3.4.z
 ```
-or to support a range of versions:
+Starting with Eigen 3.4.1, we also support a range spanning major versions:
 ```
-find_package(Eigen3 3.4...5 REQUIRED NO_MODULE)  # Any version >=3.4.0 but <6.0.0.
+find_package(Eigen3 3.4...5 REQUIRED NO_MODULE)  # Any version >=3.4.1 but <6.0.0.
 ```
 
 Do not forget to set the <a href="https://cmake.org/cmake/help/v3.7/variable/CMAKE_PREFIX_PATH.html">\c CMAKE_PREFIX_PATH </a> variable if Eigen is not installed in a default location or if you want to pick a specific version. For instance:
diff --git a/test/complex_qz.cpp b/test/complex_qz.cpp
index a6b05dc..28ab08e 100644
--- a/test/complex_qz.cpp
+++ b/test/complex_qz.cpp
@@ -18,11 +18,9 @@
 
 template <typename MatrixType>
 void generate_random_matrix_pair(const Index dim, MatrixType& A, MatrixType& B) {
-  A.resize(dim, dim);
-  B.resize(dim, dim);
-  A.setRandom();
-  B.setRandom();
-  // Set each row of B with a probability of 10% to 0
+  A.setRandom(dim, dim);
+  B.setRandom(dim, dim);
+  // Zero out each row of B to with a probability of 10%.
   for (int i = 0; i < dim; i++) {
     if (internal::random<int>(0, 10) == 0) B.row(i).setZero();
   }
@@ -59,8 +57,6 @@
 }
 
 EIGEN_DECLARE_TEST(complex_qz) {
-  // const Index dim1 = 15;
-  // const Index dim2 = 80;
   for (int i = 0; i < g_repeat; i++) {
     // Check for very small, fixed-sized double- and float complex matrices
     Eigen::Matrix2cd A_2x2, B_2x2;
@@ -71,16 +67,18 @@
     A_3x3.setRandom();
     B_3x3.setRandom();
     B_3x3.col(i % 3).setRandom();
-    // Test for small float complex matrices
-    Eigen::MatrixXcf A_float, B_float;
-    const Index dim1 = internal::random<Index>(15, 80), dim2 = internal::random<Index>(15, 80);
-    generate_random_matrix_pair(dim1, A_float, B_float);
-    // Test for a bit larger double complex matrices
-    Eigen::MatrixXcd A_double, B_double;
-    generate_random_matrix_pair(dim2, A_double, B_double);
     CALL_SUBTEST_1(complex_qz(A_2x2, B_2x2));
     CALL_SUBTEST_2(complex_qz(A_3x3, B_3x3));
+
+    // Test for float complex matrices
+    const Index dim = internal::random<Index>(15, 80);
+    Eigen::MatrixXcf A_float, B_float;
+    generate_random_matrix_pair(dim, A_float, B_float);
     CALL_SUBTEST_3(complex_qz(A_float, B_float));
+
+    // Test for double complex matrices
+    Eigen::MatrixXcd A_double, B_double;
+    generate_random_matrix_pair(dim, A_double, B_double);
     CALL_SUBTEST_4(complex_qz(A_double, B_double));
   }
 }
diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h
index bc8c8d4..c1ef70a 100644
--- a/test/gpu_test_helper.h
+++ b/test/gpu_test_helper.h
@@ -389,9 +389,6 @@
   std::cout << "  warpSize:                    " << deviceProp.warpSize << std::endl;
   std::cout << "  regsPerBlock:                " << deviceProp.regsPerBlock << std::endl;
   std::cout << "  concurrentKernels:           " << deviceProp.concurrentKernels << std::endl;
-  std::cout << "  clockRate:                   " << deviceProp.clockRate << std::endl;
-  std::cout << "  canMapHostMemory:            " << deviceProp.canMapHostMemory << std::endl;
-  std::cout << "  computeMode:                 " << deviceProp.computeMode << std::endl;
 }
 
 #endif  // EIGEN_GPUCC
diff --git a/test/main.h b/test/main.h
index db4d484..fa7053e 100644
--- a/test/main.h
+++ b/test/main.h
@@ -186,7 +186,7 @@
 
 namespace Eigen {
 static std::vector<std::string> g_test_stack;
-// level == 0 <=> abort if test fail
+// level == 0 <=> return 1 if test fail
 // level >= 1 <=> warning message to std::cerr if test fail
 static int g_test_level = 0;
 static int g_repeat = 1;
@@ -356,7 +356,7 @@
     const int test_stack_size = static_cast<int>(Eigen::g_test_stack.size());
     for (int i = test_stack_size - 1; i >= 0; --i) std::cerr << "  - " << Eigen::g_test_stack[i] << "\n";
     std::cerr << "\n";
-    if (Eigen::g_test_level == 0) abort();
+    if (Eigen::g_test_level == 0) exit(1);
   }
 }
 
@@ -858,6 +858,12 @@
   g_has_set_seed = true;
 }
 
+inline void set_seed_from_time() {
+  using namespace std::chrono;
+  long long ns = duration_cast<nanoseconds>(high_resolution_clock::now().time_since_epoch()).count();
+  g_seed = static_cast<decltype(g_seed)>(ns);
+}
+
 int main(int argc, char* argv[]) {
   g_has_set_repeat = false;
   g_has_set_seed = false;
@@ -896,7 +902,7 @@
   char* env_EIGEN_SEED = getenv("EIGEN_SEED");
   if (!g_has_set_seed && env_EIGEN_SEED) set_seed_from_string(env_EIGEN_SEED);
 
-  if (!g_has_set_seed) g_seed = (unsigned int)time(NULL);
+  if (!g_has_set_seed) set_seed_from_time();
   if (!g_has_set_repeat) g_repeat = DEFAULT_REPEAT;
 
   std::cout << "Initializing random number generator with seed " << g_seed << std::endl;
diff --git a/test/packetmath.cpp b/test/packetmath.cpp
index f21c726..18574d2 100644
--- a/test/packetmath.cpp
+++ b/test/packetmath.cpp
@@ -747,22 +747,6 @@
     }
   }
 
-  if (PacketTraits::HasBlend) {
-    Packet thenPacket = internal::pload<Packet>(data1);
-    Packet elsePacket = internal::pload<Packet>(data2);
-    EIGEN_ALIGN_MAX internal::Selector<PacketSize> selector;
-    for (int i = 0; i < PacketSize; ++i) {
-      selector.select[i] = i;
-    }
-
-    Packet blend = internal::pblend(selector, thenPacket, elsePacket);
-    EIGEN_ALIGN_MAX Scalar result[size];
-    internal::pstore(result, blend);
-    for (int i = 0; i < PacketSize; ++i) {
-      VERIFY(test::isApproxAbs(result[i], (selector.select[i] ? data1[i] : data2[i]), refvalue));
-    }
-  }
-
   {
     for (int i = 0; i < PacketSize; ++i) {
       // "if" mask
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h
index 6367db9..83fec99 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h
@@ -117,6 +117,10 @@
     return m_tensor.coeff(computeIndex(row, col));
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator[](Index row, Index col) const { return operator()(row, col); }
+#endif
+
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index computeIndex(Index row, Index col) const {
     const bool left = (side == Lhs);
     EIGEN_UNUSED_VARIABLE(left);  // annoying bug in g++8.1: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85963
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h
index 5544953..bd9a7d8 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h
@@ -691,9 +691,9 @@
   static constexpr int Layout = TensorEvaluator<IfArgType, Device>::Layout;
   enum {
     IsAligned = TensorEvaluator<ThenArgType, Device>::IsAligned & TensorEvaluator<ElseArgType, Device>::IsAligned,
-    PacketAccess = (TensorEvaluator<ThenArgType, Device>::PacketAccess &&
-                    TensorEvaluator<ElseArgType, Device>::PacketAccess && PacketType<Scalar, Device>::HasBlend) ||
-                   TernaryPacketAccess,
+    PacketAccess =
+        (TensorEvaluator<ThenArgType, Device>::PacketAccess && TensorEvaluator<ElseArgType, Device>::PacketAccess) ||
+        TernaryPacketAccess,
     BlockAccess = TensorEvaluator<IfArgType, Device>::BlockAccess &&
                   TensorEvaluator<ThenArgType, Device>::BlockAccess &&
                   TensorEvaluator<ElseArgType, Device>::BlockAccess,
@@ -789,13 +789,14 @@
 
   template <int LoadMode, bool UseTernary = TernaryPacketAccess, std::enable_if_t<!UseTernary, bool> = true>
   EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const {
-    internal::Selector<PacketSize> select;
+    EIGEN_ALIGN_TO_BOUNDARY(sizeof(PacketReturnType)) std::remove_const_t<Scalar> arr[PacketSize];
     EIGEN_UNROLL_LOOP
     for (Index i = 0; i < PacketSize; ++i) {
-      select.select[i] = m_condImpl.coeff(index + i);
+      arr[i] = m_condImpl.coeff(index + i) ? Scalar(-1) : Scalar(0);
     }
-    return internal::pblend(select, m_thenImpl.template packet<LoadMode>(index),
-                            m_elseImpl.template packet<LoadMode>(index));
+    return TernarySelectOp().template packetOp<PacketReturnType>(m_thenImpl.template packet<LoadMode>(index),
+                                                                 m_elseImpl.template packet<LoadMode>(index),
+                                                                 internal::pload<PacketReturnType>(arr));
   }
 
   template <int LoadMode, bool UseTernary = TernaryPacketAccess, std::enable_if_t<UseTernary, bool> = true>
diff --git a/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h b/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h
index 54db9bf..bc21d94 100644
--- a/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h
+++ b/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h
@@ -454,8 +454,16 @@
     }
   }
 
-  if (!(mode == 1 && isBempty) && !(mode == 2 && isBempty) && OP.info() != Success)
-    std::cout << "Error factoring matrix" << std::endl;
+  if (!(mode == 1 && isBempty) && !(mode == 2 && isBempty) && OP.info() != Success) {
+    m_info = OP.info() delete[] v;
+    delete[] iparam;
+    delete[] ipntr;
+    delete[] workd;
+    delete[] workl;
+    delete[] resid;
+    m_isInitialized = false;
+    return *this;
+  }
 
   do {
     internal::arpack_wrapper<Scalar, RealScalar>::saupd(&ido, bmat, &n, whch, &nev, &tol, resid, &ncv, v, &ldv, iparam,
@@ -572,7 +580,7 @@
   delete[] workl;
   delete[] resid;
 
-  m_isInitialized = true;
+  m_isInitialized = (m_info == Success);
 
   return *this;
 }
diff --git a/unsupported/Eigen/src/Polynomials/Companion.h b/unsupported/Eigen/src/Polynomials/Companion.h
index f080996..1b7f6e1 100644
--- a/unsupported/Eigen/src/Polynomials/Companion.h
+++ b/unsupported/Eigen/src/Polynomials/Companion.h
@@ -63,6 +63,10 @@
     }
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  EIGEN_STRONG_INLINE const Scalar_ operator[](Index row, Index col) const { return operator()(row, col); }
+#endif
+
  public:
   template <typename VectorType>
   void setPolynomial(const VectorType& poly) {
diff --git a/unsupported/Eigen/src/SparseExtra/RandomSetter.h b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
index 2889d82..54b2646 100644
--- a/unsupported/Eigen/src/SparseExtra/RandomSetter.h
+++ b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
@@ -280,6 +280,11 @@
     return m_hashmaps[outerMajor][key].value;
   }
 
+#ifdef EIGEN_MULTIDIMENSIONAL_SUBSCRIPT
+  /** \returns a reference to the coefficient at given coordinates \a row, \a col */
+  Scalar& operator[](Index row, Index col) { return operator()(row, col); }
+#endif
+
   /** \returns the number of non zero coefficients
    *
    * \note According to the underlying map/hash_map implementation,