From 9b0fcb441a44456c7b071c7cdaf90403f81ec05a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 6 Sep 2013 18:35:55 +0000 Subject: math: remove STRICT_ASSIGN macro gcc did not always drop excess precision according to c99 at assignments before version 4.5 even if -std=c99 was requested which caused badly broken mathematical functions on i386 when FLT_EVAL_METHOD!=0 but STRICT_ASSIGN was not used consistently and it is worked around for old compilers with -ffloat-store so it is no longer needed the new convention is to get the compiler respect c99 semantics and when excess precision is not harmful use float_t or double_t or to specialize code using FLT_EVAL_METHOD --- src/math/expf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/math/expf.c') diff --git a/src/math/expf.c b/src/math/expf.c index 5572bbf6..16e9afe6 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -41,7 +41,7 @@ float expf(float x) if (hx >= 0x42aeac50) { /* if |x| >= -87.33655f or NaN */ if (hx >= 0x42b17218 && !sign) { /* x >= 88.722839f */ /* overflow */ - STRICT_ASSIGN(float, x, x * 0x1p127f); + x *= 0x1p127f; return x; } if (sign) { @@ -60,7 +60,7 @@ float expf(float x) k = 1 - sign - sign; hi = x - k*ln2hi; /* k*ln2hi is exact here */ lo = k*ln2lo; - STRICT_ASSIGN(float, x, hi - lo); + x = hi - lo; } else if (hx > 0x39000000) { /* |x| > 2**-14 */ k = 0; hi = x; -- cgit 1.4.1