diff options
author | 2014-09-12 22:04:18 +0000 | |
---|---|---|
committer | 2014-09-12 22:04:18 +0000 | |
commit | eb400352b378bc3e67f5168147b9299712a58f80 (patch) | |
tree | 298506ec49cb81086333c349919a4d0a975e77a2 | |
parent | Remove cached 802.11 nodes in IEEE80211_STA_CACHE state (these are nodes (diff) | |
download | wireguard-openbsd-eb400352b378bc3e67f5168147b9299712a58f80.tar.xz wireguard-openbsd-eb400352b378bc3e67f5168147b9299712a58f80.zip |
Fix some bugs in the _Qp_sqrt implementation that would limit the accuracy
of the result in many cases. From FreeBSD allbeit with some changes to
keep the coding style consistent. This fixes the asinhl(4) issue reported
by dickman@ on tech@.
-rw-r--r-- | lib/libc/arch/sparc64/fpu/fpu_sqrt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/arch/sparc64/fpu/fpu_sqrt.c b/lib/libc/arch/sparc64/fpu/fpu_sqrt.c index be0e9d57ea8..5318f2dac0a 100644 --- a/lib/libc/arch/sparc64/fpu/fpu_sqrt.c +++ b/lib/libc/arch/sparc64/fpu/fpu_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu_sqrt.c,v 1.3 2013/11/26 20:33:07 deraadt Exp $ */ +/* $OpenBSD: fpu_sqrt.c,v 1.4 2014/09/12 22:04:18 kettenis Exp $ */ /* * Copyright (c) 1992, 1993 @@ -372,12 +372,12 @@ __fpu_sqrt(fe) FPU_SUBCS(d2, x2, t2); FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); - ODD_DOUBLE; if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; + x0 = d0, x1 = d1, x2 = d2, x3 = d3; q |= bit; y2 |= 1; } + ODD_DOUBLE; while ((bit >>= 1) != 0) { EVEN_DOUBLE; t3 = y3 | bit; @@ -386,7 +386,7 @@ __fpu_sqrt(fe) FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; + x0 = d0, x1 = d1, x2 = d2, x3 = d3; q |= bit; y3 |= bit << 1; } |