summaryrefslogtreecommitdiffstats
path: root/lib/msun/i387
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2005-10-30 12:21:02 +0000
committerbde <bde@FreeBSD.org>2005-10-30 12:21:02 +0000
commiteb7e930697ef859f2b8da44e8ed8a45aa69f4844 (patch)
treee3fc6d869d7999d224a0e5f12f78a20847cf451a /lib/msun/i387
parent90d04d11a4c99e9273edeace4b5b5e7582cb88a1 (diff)
downloadFreeBSD-src-eb7e930697ef859f2b8da44e8ed8a45aa69f4844.zip
FreeBSD-src-eb7e930697ef859f2b8da44e8ed8a45aa69f4844.tar.gz
Fixed some comments added in rev.1.5.
The log message for 1.5 said that some small (one or two ulp) inaccuracies were fixed, and a comment implied that the critical change is to switch the rounding mode to to-nearest, with a switch of the precision to extended at no extra cost. Actually, the errors are very large (ucbtest finds ones of several hundred ulps), and it is the switch of the precision that is critical. Another comment was wrong about NaNs being handled sloppily.
Diffstat (limited to 'lib/msun/i387')
-rw-r--r--lib/msun/i387/e_exp.S12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/msun/i387/e_exp.S b/lib/msun/i387/e_exp.S
index d21958c..9c87407 100644
--- a/lib/msun/i387/e_exp.S
+++ b/lib/msun/i387/e_exp.S
@@ -51,9 +51,10 @@ ENTRY(exp)
fldl 4(%esp)
/*
- * Ensure that the rounding mode is to nearest (to give the smallest
- * possible fraction) and that the precision is as high as possible.
- * We may as well mask interrupts if we switch the mode.
+ * Extended precision is needed to reduce the maximum error from
+ * hundreds of ulps to less than 1 ulp. Switch to it if necessary.
+ * We may as well set the rounding mode to to-nearest and mask traps
+ * if we switch.
*/
fstcw 4(%esp)
movl 4(%esp),%eax
@@ -81,8 +82,9 @@ ENTRY(exp)
x_Inf_or_NaN:
/*
- * Return 0 if x is -Inf. Otherwise just return x, although the
- * C version would return (x + x) (Real Indefinite) if x is a NaN.
+ * Return 0 if x is -Inf. Otherwise just return x; when x is Inf
+ * this gives Inf, and when x is a NaN this gives the same result
+ * as (x + x) (x quieted).
*/
cmpl $0xfff00000,8(%esp)
jne x_not_minus_Inf
OpenPOWER on IntegriCloud