]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: stop using fucomi* ops for 387 builds
authorKeith Randall <khr@golang.org>
Tue, 12 Jan 2016 20:42:28 +0000 (12:42 -0800)
committerKeith Randall <khr@golang.org>
Wed, 13 Jan 2016 16:23:13 +0000 (16:23 +0000)
commit3d01f28e4729b77fa528b349e1eb434c169ffa8b
tree7dfd2243e52ad4309a8b10f4d7f923aaa781411e
parentf3ce054a44a84795bec8a8155c8997226b113f76
cmd/compile: stop using fucomi* ops for 387 builds

The fucomi* opcodes were only introduced for the Pentium Pro.
They do not exist for an MMX Pentium.  Use the fucom* instructions
instead and move the condition codes from the fp flags register to
the integer flags register explicitly.

The use of fucomi* opcodes in ggen.go was introduced in 1.5 (CL 8738).
The bad ops were generated for 64-bit floating-point comparisons.

The use of fucomi* opcodes in gsubr.go dates back to at least 1.1.
The bad ops were generated for float{32,64} to uint64 conversions.

Fixes #13923

Change-Id: I5290599f5edea8abf8fb18036f44fa78bd1fc9e6
Reviewed-on: https://go-review.googlesource.com/18590
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/float_test.go [new file with mode: 0644]
src/cmd/compile/internal/x86/ggen.go
src/cmd/compile/internal/x86/gsubr.go
src/cmd/compile/internal/x86/prog.go