summaryrefslogtreecommitdiffstats
path: root/mathfuncs_convert.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-12-18 13:29:27 -0500
committerErik Schnetter <schnetter@gmail.com>2012-12-18 13:29:27 -0500
commit1c542ba7c0c13b27feee6dc2f86e053cc905ab1d (patch)
treef77b46ac22e609e7068943a32fd523eb3467c75e /mathfuncs_convert.h
parent8b733580fc720b8b128eb3d6cf3888ded3e2c46b (diff)
downloadvecmathlib-1c542ba7c0c13b27feee6dc2f86e053cc905ab1d.zip
vecmathlib-1c542ba7c0c13b27feee6dc2f86e053cc905ab1d.tar.gz
Add fdim fmax fmin, fma, isfinite isinf isnan isnormal
Diffstat (limited to 'mathfuncs_convert.h')
-rw-r--r--mathfuncs_convert.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/mathfuncs_convert.h b/mathfuncs_convert.h
index e729fce..58d0682 100644
--- a/mathfuncs_convert.h
+++ b/mathfuncs_convert.h
@@ -33,7 +33,7 @@ namespace vecmathlib {
// make unsigned by subtracting largest negative number
// (only do this for the high bits, since they have sufficient
// precision to handle the overflow)
- x ^= FP::sign_mask;
+ x ^= FP::signbit_mask;
intvec_t xhi = lsr(x, lobits);
// exponent for the equivalent floating point number
int_t exponent_hi = (FP::exponent_offset + 2*lobits) << FP::mantissa_bits;
@@ -41,7 +41,7 @@ namespace vecmathlib {
// subtract hidden mantissa bit
realvec_t fhi = as_float(xhi) - RV(FP::as_float(exponent_hi));
// add largest negative number again
- fhi -= RV(R(FP::sign_mask));
+ fhi -= RV(R(FP::signbit_mask));
// Ensure that the converted low and high bits are calculated
// separately, since a real_t doesn't have enough precision to
// hold all the bits of an int_t
@@ -59,8 +59,8 @@ namespace vecmathlib {
// Handle zero
boolvec_t is_zero = x == RV(0.0);
// Handle overflow
- int_t min_int = FP::sign_mask;
- int_t max_int = ~FP::sign_mask;
+ int_t min_int = FP::signbit_mask;
+ int_t max_int = ~FP::signbit_mask;
boolvec_t is_overflow = x < RV(R(min_int)) || x > RV(R(max_int));
// Handle negative numbers
boolvec_t is_negative = signbit(x);
OpenPOWER on IntegriCloud