[project @ 2002-02-13 14:05:50 by simonpj]
[ghc-hetmet.git] / ghc / compiler / nativeGen / MachCode.lhs
index 8c3937f..1806565 100644 (file)
@@ -1241,6 +1241,7 @@ getRegister (StMachOp mop [x]) -- unary PrimOps
   = case mop of
       MO_NatS_Neg      -> trivialUCode (SUB False False g0) x
       MO_Nat_Not       -> trivialUCode (XNOR False g0) x
+      MO_32U_to_8U     -> trivialCode (AND False) x (StInt 255)
 
       MO_Flt_Neg       -> trivialUFCode FloatRep (FNEG F) x
       MO_Dbl_Neg       -> trivialUFCode DoubleRep (FNEG DF) x
@@ -1265,6 +1266,7 @@ getRegister (StMachOp mop [x]) -- unary PrimOps
       MO_NatP_to_NatS -> conversionNop IntRep    x
 
       -- sign-extending widenings
+      MO_8U_to_32U    -> integerExtend False 24 x
       MO_8U_to_NatU   -> integerExtend False 24 x
       MO_8S_to_NatS   -> integerExtend True  24 x
       MO_16U_to_NatU  -> integerExtend False 16 x
@@ -2716,7 +2718,7 @@ genCCall fn cconv ret_rep args
            -> returnNat (unitOL (CALL (Left (fn__2 tot_arg_size))))
         Right dyn 
            -> get_op dyn `thenNat` \ (dyn_c, dyn_r, dyn_rep) ->
-              ASSERT(dyn_rep == L)
+              ASSERT(case dyn_rep of { L -> True; _ -> False})
               returnNat (dyn_c `snocOL` CALL (Right dyn_r))
     ) 
                                `thenNat` \ callinsns ->