diff options
| author | sewardj <unknown> | 2000-01-26 13:40:54 +0000 |
|---|---|---|
| committer | sewardj <unknown> | 2000-01-26 13:40:54 +0000 |
| commit | 4c892ba00b965e000246fb1f5954ee73cb1b24c0 (patch) | |
| tree | 862b2f8765d3a348bc12cb00bed276d90d8c1349 /ghc/compiler/nativeGen/AsmCodeGen.lhs | |
| parent | 19cb8555b01ba50f44ecece31bd857748f183779 (diff) | |
| download | haskell-4c892ba00b965e000246fb1f5954ee73cb1b24c0.tar.gz | |
[project @ 2000-01-26 13:40:54 by sewardj]
Observe the C conventions for use of the FP register stack. In particular,
free up any live fp registers prior to non-local control transfers. Sigh.
This is not good. The FP situation needs to be reviewed once the rest
of x86 nativeGen is stable.
Diffstat (limited to 'ghc/compiler/nativeGen/AsmCodeGen.lhs')
| -rw-r--r-- | ghc/compiler/nativeGen/AsmCodeGen.lhs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ghc/compiler/nativeGen/AsmCodeGen.lhs b/ghc/compiler/nativeGen/AsmCodeGen.lhs index 13a59ef22b..7da3a0b884 100644 --- a/ghc/compiler/nativeGen/AsmCodeGen.lhs +++ b/ghc/compiler/nativeGen/AsmCodeGen.lhs @@ -6,6 +6,7 @@ module AsmCodeGen ( nativeCodeGen ) where #include "HsVersions.h" +#include "nativeGen/NCG.h" import IO ( Handle ) import List ( intersperse ) @@ -26,10 +27,10 @@ import PrimRep ( isFloatingRep ) import UniqSupply ( returnUs, thenUs, mapUs, initUs, initUs_, UniqSM, UniqSupply ) import UniqFM ( UniqFM, emptyUFM, addToUFM, lookupUFM ) +import MachMisc ( IF_ARCH_i386(i386_insert_ffrees,) ) + import Outputable -import GlaExts (trace) --tmp -#include "nativeGen/NCG.h" \end{code} The 96/03 native-code generator has machine-independent and @@ -97,7 +98,11 @@ codeGen :: [[StixTree]] -> UniqSM SDoc codeGen stixFinal = mapUs genMachCode stixFinal `thenUs` \ dynamic_codes -> let - static_instrss = scheduleMachCode dynamic_codes + fp_kludge :: [Instr] -> [Instr] + fp_kludge = IF_ARCH_i386(i386_insert_ffrees,id) + + static_instrss :: [[Instr]] + static_instrss = map fp_kludge (scheduleMachCode dynamic_codes) docs = map (vcat . map pprInstr) static_instrss in returnUs (vcat (intersperse (char ' ' |
