|
@@ -576,12 +576,12 @@ namespace SCTL_NAMESPACE {
|
|
// )
|
|
// )
|
|
// ); // int_e2 = int_one + (int_x_ << SigBits);
|
|
// ); // int_e2 = int_one + (int_x_ << SigBits);
|
|
IntegerVec int_e2 = IntegerVec(int_one) + (int_x_ << SigBits);
|
|
IntegerVec int_e2 = IntegerVec(int_one) + (int_x_ << SigBits);
|
|
- e2 = RealVec::LoadAligned((double*)&int_e2);
|
|
|
|
|
|
|
|
// Handle underflow
|
|
// Handle underflow
|
|
- static constexpr Integer max_exp = (2UL<<((sizeof(Real)*8-SigBits-3)));
|
|
|
|
- auto underflow_cond = (int_x_ > IntegerVec(-max_exp));
|
|
|
|
- e2 &= RealVec::LoadAligned((const RealType*)&underflow_cond);
|
|
|
|
|
|
+ static constexpr IntegerType max_exp = -(1UL<<((sizeof(Real)*8-SigBits-2)));
|
|
|
|
+ int_e2 &= (int_x_ > IntegerVec(max_exp));
|
|
|
|
+
|
|
|
|
+ e2 = RealVec::LoadAligned((RealType*)&int_e2);
|
|
}
|
|
}
|
|
|
|
|
|
expx = e1 * e2;
|
|
expx = e1 * e2;
|
|
@@ -783,6 +783,7 @@ namespace SCTL_NAMESPACE {
|
|
|
|
|
|
template <class Vec> friend Vec RoundReal2Real(const Vec& x);
|
|
template <class Vec> friend Vec RoundReal2Real(const Vec& x);
|
|
template <class Vec> friend void sincos_intrin(Vec& sinx, Vec& cosx, const Vec& x);
|
|
template <class Vec> friend void sincos_intrin(Vec& sinx, Vec& cosx, const Vec& x);
|
|
|
|
+ template <class Vec> friend void exp_intrin(Vec& expx, const Vec& x);
|
|
|
|
|
|
private:
|
|
private:
|
|
|
|
|
|
@@ -800,6 +801,10 @@ namespace SCTL_NAMESPACE {
|
|
sinx.v = _mm256_sin_pd(x.v);
|
|
sinx.v = _mm256_sin_pd(x.v);
|
|
cosx.v = _mm256_cos_pd(x.v);
|
|
cosx.v = _mm256_cos_pd(x.v);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ template <> inline void exp_intrin(Vec<double,4>& expx, const Vec<double,4>& x) {
|
|
|
|
+ expx.v = _mm256_exp_pd(x.v);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#endif
|
|
#endif
|