@@ -118,6 +118,11 @@ namespace xsimd
118118 }
119119 template <class A , class T_out , class T_in >
120120 XSIMD_INLINE batch<T_out, A> batch_cast (batch<T_in, A> const & self, batch<T_out, A> const &, requires_arch<common>, with_slow_conversion) noexcept
121+ #if defined (__clang__) || __GNUC__
122+ __attribute__ ((no_sanitize(" undefined" )));
123+ #endif
124+ template <class A , class T_out , class T_in >
125+ XSIMD_INLINE batch<T_out, A> batch_cast (batch<T_in, A> const & self, batch<T_out, A> const &, requires_arch<common>, with_slow_conversion) noexcept
121126 {
122127 static_assert (!std::is_same<T_in, T_out>::value, " there should be no conversion for this type combination" );
123128 using batch_type_in = batch<T_in, A>;
@@ -126,7 +131,8 @@ namespace xsimd
126131 alignas (A::alignment ()) T_in buffer_in[batch_type_in::size];
127132 alignas (A::alignment ()) T_out buffer_out[batch_type_out::size];
128133 self.store_aligned (&buffer_in[0 ]);
129- std::copy (std::begin (buffer_in), std::end (buffer_in), std::begin (buffer_out));
134+ for (size_t i = 0 ; i < batch_type_in::size; ++i)
135+ buffer_out[i] = static_cast <T_out>(buffer_in[i]);
130136 return batch_type_out::load_aligned (buffer_out);
131137 }
132138
@@ -2010,7 +2016,9 @@ namespace xsimd
20102016 auto negself = self < zero;
20112017 auto iszeropowpos = self == zero && other >= zero;
20122018 auto adj_self = select (iszeropowpos, batch_type (1 ), abs (self));
2013- batch_type z = exp (other * log (adj_self));
2019+ auto log_adj_self = log (adj_self);
2020+ auto t = other * log_adj_self;
2021+ batch_type z = exp (t);
20142022 z = select (iszeropowpos, zero, z);
20152023 z = select (is_odd (other) && negself, -z, z);
20162024 auto invalid = negself && !(is_flint (other) || isinf (other));
0 commit comments