From 9dacc7077634a55dcdf7be3fb32d5996c5293b0e Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Tue, 25 Jan 2000 14:40:32 +0000
Subject: [PATCH] [project @ 2000-01-25 14:40:32 by sewardj] x86: free up all
 FP regs before doing a ccall.  This appears to be a part of the x86 calling
 convention(s).

---
 ghc/compiler/nativeGen/PprMach.lhs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ghc/compiler/nativeGen/PprMach.lhs b/ghc/compiler/nativeGen/PprMach.lhs
index ac051ee738d1..8c686d473fb4 100644
--- a/ghc/compiler/nativeGen/PprMach.lhs
+++ b/ghc/compiler/nativeGen/PprMach.lhs
@@ -1000,7 +1000,10 @@ pprInstr (JMP (OpImm imm)) = (<>) (ptext SLIT("\tjmp ")) (pprImm imm)
 pprInstr (JMP op) = (<>) (ptext SLIT("\tjmp *")) (pprOperand L op)
 
 pprInstr (CALL imm)
-   = hcat [ ptext SLIT("\tffree %st(0) ; call "), pprImm imm ]
+   = vcat [ ptext SLIT("\tffree %st(0) ;ffree %st(1) ;ffree %st(2) ;ffree %st(3)"),
+            ptext SLIT("\tffree %st(4) ;ffree %st(5) ;ffree %st(6) ;ffree %st(7)"),
+            hcat [ ptext SLIT("\tcall "), pprImm imm ]
+          ]
 
 
 -- Simulating a flat register set on the x86 FP stack is tricky.
-- 
GitLab