summaryrefslogtreecommitdiff
path: root/ghc/compiler/nativeGen/MachMisc.lhs
diff options
context:
space:
mode:
authorsewardj <unknown>2001-12-10 18:04:52 +0000
committersewardj <unknown>2001-12-10 18:04:52 +0000
commit0d1a15fd5f3396ae711483b446c4b982083e5c87 (patch)
tree9d16f620a427c323567ece32bf5233f1daa33993 /ghc/compiler/nativeGen/MachMisc.lhs
parent9428b42b8e4b21493055b54f176cffa0a5b879b6 (diff)
downloadhaskell-0d1a15fd5f3396ae711483b446c4b982083e5c87.tar.gz
[project @ 2001-12-10 18:04:51 by sewardj]
Add just enough infrastructure to the NCG that it can deal with simple 64-bit code on 32-bit platforms. Main changes are: * Addition of a simple 64-bit instruction selection fn iselExpr64 to MachCode. This generates code for a 64-bit value and places the results into two virtual registers, related thusly: * Add a new type VRegUnique, which is used to label Stix virtual registers. This type used to be a plain Unique, but that forces the assumption that each Abstract-C level C temporary corresponds to exactly one Stix virtual register, which is untrue when the C temporary is 64-bit sized on a 32-bit machine. In the new scheme, the Unique for the C temporary can turn into two related VRegUniques, related by having the same embedded unique. * Made a start on 'target metrics' by adding ncg_target_is_32bits to the end of Stix.lhs. * Cleaned up numerous other gruesomenesses in the NCG which never came to light before now. Got rid of MachMisc.sizeOf, which doesn't make sense in a 64-bit setting, and replaced it by calls to PrimRep.getPrimRepArrayElemSize, which, as far as I'm concerned, is the definitive answer to the questio `How Big Is This PrimRep Really?' Result: on x86-linux, at least, you can now compile the Entire Prelude with -fasm! At this stage I cannot claim that the resulting code is correct, but it's a start.
Diffstat (limited to 'ghc/compiler/nativeGen/MachMisc.lhs')
-rw-r--r--ghc/compiler/nativeGen/MachMisc.lhs14
1 files changed, 1 insertions, 13 deletions
diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs
index ce88dd3f14..4aa230be7b 100644
--- a/ghc/compiler/nativeGen/MachMisc.lhs
+++ b/ghc/compiler/nativeGen/MachMisc.lhs
@@ -8,7 +8,7 @@
module MachMisc (
- sizeOf, primRepToSize,
+ primRepToSize,
eXTRA_STK_ARGS_HERE,
@@ -93,18 +93,6 @@ eXTRA_STK_ARGS_HERE
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Size of a @PrimRep@, in bytes.
-
-\begin{code}
-sizeOf :: PrimRep -> Int{-in bytes-}
-sizeOf pr = case primRepToSize pr of
- IF_ARCH_alpha({B->1; Bu->1; {-W->2; Wu->2;-} L->4; {-SF->4;-} Q->8; TF->8},)
- IF_ARCH_i386 ({B->1; Bu->1; W->2; Wu->2; L->4; Lu->4; F->4; DF->8; F80->10},)
- IF_ARCH_sparc({B->1; Bu->1; W->4; F->4; DF->8},)
-\end{code}
-
-% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
Now the volatile saves and restores. We add the basic guys to the
list of ``user'' registers provided. Note that there are more basic
registers on the restore list, because some are reloaded from