Closed
Description
I propose dropping 387 floating-point support and requiring SSE2 support for GOARCH=386 in the native gc compiler for Go 1.16. This would raise the minimum GOARCH=386 requirement to the Intel Pentium 4 (released in 2000) or AMD Opteron/Athlon 64 (released in 2003).
We would need to pre-announce this in the 1.15 release notes. (I've put it in the 1.15 milestone for this reason.)
There are several benefits to doing this:
- While 387 support isn’t a huge maintenance burden, it does take time away from performance and feature work and represents a fair amount of latent complexity.
- 387 support has been a regular source of bugs (cmd/compile: constant propagation in compiler converts signaling NaN to quiet NaN #36400, cmd/compile: 387 quietens signalling NaNs during compilation #27516, cmd/compile: invalid instruction error for FMOVD when compiling for 387 #22429, math: math on 387 does not match float64 due to extended exponents #17357, cmd/compile: Illegal instruction 'fucomip' on 386 with GO386=387 #13923, possible non-387 instructions in a GO386=387 build #12970, cmd/8c: use of prefetchnta requires SSE #4798, just to name a few).
- 387 bugs often go undetected for a long time because we don’t have builders that support only 387 (so unsupported instructions can slip in unnoticed).
- Raising the minimum requirement to SSE2 would allow us to also assume many other useful architectural features, such as proper memory fences and 128 bit registers, which would simplify the compiler and runtime and allow for much more efficient implementations of core functions like memmove on 386.
- We’re exploring switching to a register-based calling convention in Go 1.16, which promises significant performance improvements, but retaining 387 support will definitely complicate this and slow our progress.
The gccgo toolchain will continue to support 387 floating-point, so this remains an option for projects that absolutely must use 387 floating-point.
I proposed this on golang-nuts to get feedback on significant uses of GO386=387, particularly for which using gccgo would not be a viable option.