summaryrefslogtreecommitdiffstats
path: root/mathfuncs_convert.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-06-02 21:36:42 -0400
committerErik Schnetter <schnetter@gmail.com>2013-06-02 21:36:42 -0400
commit22468c8d61094e7aca952c71b862b6972a12db4f (patch)
treede95550358514cbb0f7238c9be8b77cc9b026196 /mathfuncs_convert.h
parent6411bd494c3238bd4b55e8e4d67e1dc56fecb92f (diff)
downloadvecmathlib-22468c8d61094e7aca952c71b862b6972a12db4f.zip
vecmathlib-22468c8d61094e7aca952c71b862b6972a12db4f.tar.gz
Add barrier in vml_antitrunc to ensure floating point accuracy
Diffstat (limited to 'mathfuncs_convert.h')
-rw-r--r--mathfuncs_convert.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mathfuncs_convert.h b/mathfuncs_convert.h
index 4001834..d93d9d6 100644
--- a/mathfuncs_convert.h
+++ b/mathfuncs_convert.h
@@ -164,6 +164,7 @@ namespace vecmathlib {
realvec_t mask = ldexp(RV(2.0), nbits) - RV(1.0);
intvec_t imask = IV(FP::signbit_mask | FP::exponent_mask) | as_int(mask);
realvec_t offset = RV(1.0) - ldexp(RV(1.0), nbits - IV(FP::mantissa_bits));
+ offset.barrier();
realvec_t y = as_float(as_int(x + offset) & imask);
realvec_t r =
copysign(ifthen(iszero, RV(0.0),
OpenPOWER on IntegriCloud