[project @ 2001-01-21 16:37:22 by sewardj]
authorsewardj <unknown>
Sun, 21 Jan 2001 16:37:22 +0000 (16:37 +0000)
committersewardj <unknown>
Sun, 21 Jan 2001 16:37:22 +0000 (16:37 +0000)
Add support for Word#.

ghc/compiler/ghci/ByteCodeGen.lhs
ghc/compiler/ghci/ByteCodeLink.lhs

index 5b5cc23..14f0ed4 100644 (file)
@@ -330,7 +330,7 @@ schemeE d s p (fvs, AnnCase scrut bndr alts)
         scrut_primrep = typePrimRep (idType bndr)
         isAlgCase
            = case scrut_primrep of
-                CharRep -> False ; AddrRep -> False
+                CharRep -> False ; AddrRep -> False ; WordRep -> False
                 IntRep -> False ; FloatRep -> False ; DoubleRep -> False
                 PtrRep -> True
                 other  -> pprPanic "ByteCodeGen.schemeE" (ppr other)
@@ -621,6 +621,7 @@ pushAtom True d p (AnnLit lit)
 
 pushAtom False d p (AnnLit lit)
    = case lit of
+        MachWord w   -> code WordRep
         MachInt i    -> code IntRep
         MachFloat r  -> code FloatRep
         MachDouble r -> code DoubleRep
index 0bb6906..2792b3d 100644 (file)
@@ -271,6 +271,7 @@ mkBits findLabel st proto_insns
           = do st_I1 <- addToSS st_I0 (getName dcon)
                return (sizeSS st_I0, (st_i0,st_l0,st_p0,st_I1))
 
+       literal st (MachWord w)   = int st (fromIntegral w)
        literal st (MachInt j)    = int st (fromIntegral j)
        literal st (MachFloat r)  = float st (fromRational r)
        literal st (MachDouble r) = double st (fromRational r)
@@ -281,6 +282,7 @@ mkBits findLabel st proto_insns
             where
                ret_itbl_addr = case pk of
                                   PtrRep    -> stg_ctoi_ret_R1p_info
+                                  WordRep   -> stg_ctoi_ret_R1n_info
                                   IntRep    -> stg_ctoi_ret_R1n_info
                                   AddrRep   -> stg_ctoi_ret_R1n_info
                                   CharRep   -> stg_ctoi_ret_R1n_info