]> Cypherpunks.ru repositories - gostls13.git/commit
math: remove most 387 implementations
authorRuss Cox <rsc@golang.org>
Thu, 11 Feb 2021 04:41:23 +0000 (23:41 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:41:09 +0000 (00:41 +0000)
commit474d5f4f4d0547d1c6d7a14f1ba02afffc4725d4
tree9bdfee8a8e3a71d87526c1062715e2eddf238231
parentc7c6c113be96b7b68f54696d2986f98dc9df64d6
math: remove most 387 implementations

The Surface Pro X's 386 simulator is not completely faithful to a real 387.
The most egregious problem is that it computes Log2(8) as 2.9999999999999996,
but it has some other subtler problems as well. All the problems occur in
routines that we don't even bother with assembly for on amd64.
If the speed of Go code is OK on amd64 it should be OK on 386 too.
Just remove all the 386-only assembly functions.

This leaves Ceil, Floor, Trunc, Hypot, and Sqrt in 386 assembly,
all of which are also in assembly on amd64 and all of which pass
their tests on Surface Pro X.

Compared to amd64, the 386 port omits assembly for Min, Max, and Log.
It never had Min and Max, and this CL deletes Log because Log2 wasn't
even correct. (None of the other architectures have assembly Log either.)

Change-Id: I5eb6c61084467035269d4098a36001447b7a0601
Reviewed-on: https://go-review.googlesource.com/c/go/+/291229
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
14 files changed:
src/math/asin_386.s [deleted file]
src/math/atan2_386.s [deleted file]
src/math/atan_386.s [deleted file]
src/math/exp2_386.s [deleted file]
src/math/expm1_386.s [deleted file]
src/math/frexp_386.s [deleted file]
src/math/ldexp_386.s [deleted file]
src/math/log10_386.s [deleted file]
src/math/log1p_386.s [deleted file]
src/math/log_386.s [deleted file]
src/math/mod_386.s [deleted file]
src/math/modf_386.s [deleted file]
src/math/remainder_386.s [deleted file]
src/math/stubs_386.s