summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2008-01-19 22:05:14 +0000
committerbde <bde@FreeBSD.org>2008-01-19 22:05:14 +0000
commit2005bbb395bb7f0b8875c19bc5414a4cc62fbdac (patch)
treedf50e9a8fd313ca5eab645acc93b1b4a02ee6084 /lib
parentd6e95041fdf4f52ffc5b230ed26d10ba080747e2 (diff)
downloadFreeBSD-src-2005bbb395bb7f0b8875c19bc5414a4cc62fbdac.zip
FreeBSD-src-2005bbb395bb7f0b8875c19bc5414a4cc62fbdac.tar.gz
Do an ordinary assignment in STRICT_ASSIGN() except for floats until
there is a problem with non-floats (when i386 defaults to extra precision). This essentially restores yesterday's behaviour for doubles on i386 (since generic rint() isn't used and everywhere else assumed working assignment), but for arches that use the generic rint() it finishes restoring some of 1995's behaviour (don't waste time doing unnecessary store/load).
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/src/math_private.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index 15ef4fb..3514712 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -164,8 +164,12 @@ do { \
#define STRICT_ASSIGN(type, lval, rval) do { \
volatile type __lval; \
\
- __lval = (rval); \
- (lval) = __lval; \
+ if (sizeof(type) >= sizeof(double)) \
+ (lval) = (rval); \
+ else { \
+ __lval = (rval); \
+ (lval) = __lval; \
+ } \
} while (0)
#endif
#endif
OpenPOWER on IntegriCloud