summaryrefslogtreecommitdiff
path: root/ghc/compiler/nativeGen
diff options
context:
space:
mode:
authorsimonpj <unknown>1998-12-18 17:42:39 +0000
committersimonpj <unknown>1998-12-18 17:42:39 +0000
commit7e602b0a11e567fcb035d1afd34015aebcf9a577 (patch)
tree54ca13c3ec0704e343b68d0d313a29f53d6c3855 /ghc/compiler/nativeGen
parent139f0fd30e19f934aa51885a52b8e5d7c24ee460 (diff)
downloadhaskell-7e602b0a11e567fcb035d1afd34015aebcf9a577.tar.gz
[project @ 1998-12-18 17:40:31 by simonpj]
Another big commit from Simon. Actually, the last one didn't all go into the main trunk; because of a CVS glitch it ended up in the wrong branch. So this commit includes: * Scoped type variables * Warnings for unused variables should work now (they didn't before) * Simplifier improvements: - Much better treatment of strict arguments - Better treatment of bottoming Ids - No need for w/w split for fns that are merely strict - Fewer iterations needed, I hope * Less gratuitous renaming in interface files and abs C * OccName is a separate module, and is an abstract data type I think the whole Prelude and Exts libraries compile correctly. Something isn't quite right about typechecking existentials though.
Diffstat (limited to 'ghc/compiler/nativeGen')
-rw-r--r--ghc/compiler/nativeGen/AbsCStixGen.lhs3
-rw-r--r--ghc/compiler/nativeGen/AsmCodeGen.lhs73
-rw-r--r--ghc/compiler/nativeGen/AsmRegAlloc.lhs2
-rw-r--r--ghc/compiler/nativeGen/MachCode.lhs4
-rw-r--r--ghc/compiler/nativeGen/MachMisc.lhs2
5 files changed, 5 insertions, 79 deletions
diff --git a/ghc/compiler/nativeGen/AbsCStixGen.lhs b/ghc/compiler/nativeGen/AbsCStixGen.lhs
index bb7c0f5f0b..d692cdb43a 100644
--- a/ghc/compiler/nativeGen/AbsCStixGen.lhs
+++ b/ghc/compiler/nativeGen/AbsCStixGen.lhs
@@ -33,7 +33,8 @@ import StixInfo ( genCodeInfoTable, genBitmapInfoTable )
import StixMacro ( macroCode, checkCode )
import StixPrim ( primCode, amodeToStix, amodeToStix' )
import UniqSupply ( returnUs, thenUs, mapUs, getUniqueUs, UniqSM )
-import Util ( naturalMergeSortLe, panic )
+import Util ( naturalMergeSortLe )
+import Panic ( panic )
import BitSet ( intBS )
#ifdef REALLY_HASKELL_1_3
diff --git a/ghc/compiler/nativeGen/AsmCodeGen.lhs b/ghc/compiler/nativeGen/AsmCodeGen.lhs
index ce8587bfcb..1e297add57 100644
--- a/ghc/compiler/nativeGen/AsmCodeGen.lhs
+++ b/ghc/compiler/nativeGen/AsmCodeGen.lhs
@@ -21,13 +21,8 @@ import OrdList ( OrdList )
import PrimOp ( commutableOp, PrimOp(..) )
import RegAllocInfo ( mkMRegsState, MRegsState )
import Stix ( StixTree(..), StixReg(..) )
-import PrimRep ( isFloatingRep )
import UniqSupply ( returnUs, thenUs, mapUs, initUs, UniqSM, UniqSupply )
-import UniqFM ( UniqFM, emptyUFM, addToUFM, lookupUFM )
import Outputable
-
-import GlaExts (trace) --tmp
-#include "nativeGen/NCG.h"
\end{code}
The 96/03 native-code generator has machine-independent and
@@ -90,14 +85,7 @@ runNCG absC
let
stix = map (map genericOpt) treelists
in
-#if i386_TARGET_ARCH
- let
- stix' = map floatFix stix
- in
- codeGen stix'
-#else
codeGen stix
-#endif
\end{code}
@codeGen@ is the top-level code-generation function:
@@ -294,64 +282,3 @@ Anything else is just too hard.
\begin{code}
primOpt op args = StPrim op args
\end{code}
-
------------------------------------------------------------------------------
-Fix up floating point operations for x86.
-
-The problem is that the code generator can't handle the weird register
-naming scheme for floating point registers on the x86, so we have to
-deal with memory-resident floating point values wherever possible.
-
-We therefore can't stand references to floating-point kinded temporary
-variables, and try to translate them into memory addresses wherever
-possible.
-
-\begin{code}
-floatFix :: [StixTree] -> [StixTree]
-floatFix trees = fltFix emptyUFM trees
-
-fltFix :: UniqFM StixTree -- mapping tmp vars to memory locations
- -> [StixTree]
- -> [StixTree]
-fltFix locs [] = []
-
--- The case we're interested in: loading a temporary from a memory
--- address. Eliminate the instruction and replace all future references
--- to the temporary with the memory address.
-fltFix locs ((StAssign rep (StReg (StixTemp uq _)) loc) : trees)
- | isFloatingRep rep = trace "found one" $ fltFix (addToUFM locs uq loc) trees
-
-fltFix locs ((StAssign rep src dst) : trees)
- = StAssign rep (fltFix1 locs src) (fltFix1 locs dst) : fltFix locs trees
-
-fltFix locs (tree : trees)
- = fltFix1 locs tree : fltFix locs trees
-
-
-fltFix1 :: UniqFM StixTree -> StixTree -> StixTree
-fltFix1 locs r@(StReg (StixTemp uq rep))
- | isFloatingRep rep = case lookupUFM locs uq of
- Nothing -> panic "fltFix1"
- Just tree -> trace "substed" $ tree
-
-fltFix1 locs (StIndex rep l r) =
- StIndex rep (fltFix1 locs l) (fltFix1 locs r)
-
-fltFix1 locs (StInd rep tree) =
- StInd rep (fltFix1 locs tree)
-
-fltFix1 locs (StAssign rep dst src) = panic "fltFix1: StAssign"
-
-fltFix1 locs (StJump tree) = StJump (fltFix1 locs tree)
-
-fltFix1 locs (StCondJump label tree) =
- StCondJump label (fltFix1 locs tree)
-
-fltFix1 locs (StPrim op trees) =
- StPrim op (map (fltFix1 locs) trees)
-
-fltFix1 locs (StCall f conv rep trees) =
- StCall f conv rep (map (fltFix1 locs) trees)
-
-fltFix1 locs tree = tree
-\end{code}
diff --git a/ghc/compiler/nativeGen/AsmRegAlloc.lhs b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
index 398170ec4b..9a6fca0ca4 100644
--- a/ghc/compiler/nativeGen/AsmRegAlloc.lhs
+++ b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
@@ -19,7 +19,7 @@ import OrdList ( mkEmptyList, mkUnitList, mkSeqList, mkParList,
flattenOrdList, OrdList
)
import Unique ( mkBuiltinUnique )
-import Util ( mapAccumB, panic, trace )
+import Util ( mapAccumB )
import Outputable
\end{code}
diff --git a/ghc/compiler/nativeGen/MachCode.lhs b/ghc/compiler/nativeGen/MachCode.lhs
index 22ae785d68..fde05dd715 100644
--- a/ghc/compiler/nativeGen/MachCode.lhs
+++ b/ghc/compiler/nativeGen/MachCode.lhs
@@ -33,7 +33,6 @@ import UniqSupply ( returnUs, thenUs, mapUs, mapAndUnzipUs,
mapAccumLUs, UniqSM
)
import Outputable
-import GlaExts (trace) --tmp
\end{code}
Code extractor for an entire stix tree---stix statement level.
@@ -1847,8 +1846,7 @@ assignFltCode pk (StInd _ dst) src
returnUs code__2
assignFltCode pk dst src
- = trace "assignFltCode: dodgy floating point instruction" $
- getRegister dst `thenUs` \ register1 ->
+ = getRegister dst `thenUs` \ register1 ->
getRegister src `thenUs` \ register2 ->
--getNewRegNCG (registerRep register2)
-- `thenUs` \ tmp ->
diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs
index 4ec74c378c..16fa5fdac7 100644
--- a/ghc/compiler/nativeGen/MachMisc.lhs
+++ b/ghc/compiler/nativeGen/MachMisc.lhs
@@ -49,7 +49,7 @@ import MachRegs ( stgReg, callerSaves, RegLoc(..),
import PrimRep ( PrimRep(..) )
import SMRep ( SMRep(..) )
import Stix ( StixTree(..), StixReg(..), CodeSegment )
-import Util ( panic )
+import Panic ( panic )
import Char ( isDigit )
import GlaExts ( word2Int#, int2Word#, shiftRL#, and#, (/=#) )
\end{code}