aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/x86/ssa.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/x86/ssa.go')
-rw-r--r--src/cmd/compile/internal/x86/ssa.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/x86/ssa.go b/src/cmd/compile/internal/x86/ssa.go
index 03ab8d3af3..e941e6cda7 100644
--- a/src/cmd/compile/internal/x86/ssa.go
+++ b/src/cmd/compile/internal/x86/ssa.go
@@ -139,6 +139,13 @@ func opregreg(op obj.As, dest, src int16) *obj.Prog {
func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
s.SetLineno(v.Line)
+
+ if gc.Thearch.Use387 {
+ if ssaGenValue387(s, v) {
+ return // v was handled by 387 generation.
+ }
+ }
+
switch v.Op {
case ssa.Op386ADDL:
r := gc.SSARegNum(v)
@@ -899,6 +906,11 @@ var nefJumps = [2][2]gc.FloatingEQNEJump{
func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
s.SetLineno(b.Line)
+ if gc.Thearch.Use387 {
+ // Empty the 387's FP stack before the block ends.
+ flush387(s)
+ }
+
switch b.Kind {
case ssa.BlockPlain, ssa.BlockCall, ssa.BlockCheck:
if b.Succs[0].Block() != next {