Disclaimer: I'm unsure if casting float64s is desirable. This is just a shot-in-the-dark idea.
Instead of us hosting the assembly implementation for 64 bit architectures we could provide an additional boolean build flag similar to haveArchFunc, but indicating that the Go standard library has the 64 bit implementation, thus we can just use a wrapper func style implementation.
This may be clearer if I illustrate with an example
Today The Sqrt implementation is as follows:
Due to recent developments, some assembly implementations have been discovered to be broken.
An idea for 64bit assembly implementations
Disclaimer: I'm unsure if casting float64s is desirable. This is just a shot-in-the-dark idea.
Instead of us hosting the assembly implementation for 64 bit architectures we could provide an additional boolean build flag similar to
haveArchFunc
, but indicating that the Go standard library has the 64 bit implementation, thus we can just use a wrapper func style implementation.This may be clearer if I illustrate with an example Today The Sqrt implementation is as follows:
I propose adding a new constant
haveStdlibSqrt
and a new filesqrt_stdlib.go
. The above code changes as followsThe new file
sqrt_stdlib.go
has the following contents.