summaryrefslogtreecommitdiffstats
path: root/vec_sse_float1.h
diff options
context:
space:
mode:
Diffstat (limited to 'vec_sse_float1.h')
-rw-r--r--vec_sse_float1.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/vec_sse_float1.h b/vec_sse_float1.h
index 6aa42dc..d3039ad 100644
--- a/vec_sse_float1.h
+++ b/vec_sse_float1.h
@@ -419,14 +419,25 @@ namespace vecmathlib {
return to_float(_mm_min_ss(from_float(v), from_float(y.v)));
}
realvec fmod(realvec y) const { return std::fmod(v, y.v); }
- realvec frexp(intvec_t& r) const { return MF::vml_frexp(*this, r); }
+ realvec frexp(intvec_t& ir) const
+ {
+ realvec r = std::frexp(v, &ir.v);
+ if (isinf()) ir.v = std::numeric_limits<int_t>::max();
+ if (isnan()) ir.v = std::numeric_limits<int_t>::max();
+ return r;
+ }
realvec hypot(realvec y) const { return MF::vml_hypot(*this, y); }
intvec_t ilogb() const
{
int_t r = std::ilogb(v);
typedef std::numeric_limits<int_t> NL;
- if (FP_ILOGB0 == NL::min() and r == FP_ILOGB0) r = NL::min();
- else if (FP_ILOGBNAN == NL::max() and r == FP_ILOGBNAN) r = NL::max();
+ if (FP_ILOGB0 != NL::min() and *this == RV(R(0.0))) {
+ r = NL::min();
+#if defined VML_HAVE_NAN
+ } else if (FP_ILOGBNAN != NL::max() and isnan()) {
+ r = NL::max();
+#endif
+ }
return r;
}
boolvec_t isfinite() const { return std::isfinite(v); }
OpenPOWER on IntegriCloud