Split Reg into vreg/hreg and add register pairs
[ghc-hetmet.git] / compiler / nativeGen / PPC / CodeGen.hs
index 6661a3e..d3ec27f 100644 (file)
@@ -55,6 +55,11 @@ import Data.Bits
 import Data.Int
 import Data.Word
 
+#if darwin_TARGET_OS || linux_TARGET_OS
+import BasicTypes
+import FastString
+#endif
+
 -- -----------------------------------------------------------------------------
 -- Top-level of the instruction selector
 
@@ -175,7 +180,7 @@ getRegisterReg (CmmLocal (LocalReg u pk))
 
 getRegisterReg (CmmGlobal mid)
   = case get_GlobalReg_reg_or_addr mid of
-       Left (RealReg rrno) -> RealReg rrno
+       Left reg@(RegReal _) -> reg
        _other -> pprPanic "getRegisterReg-memory" (ppr $ CmmGlobal mid)
           -- By this stage, the only MagicIds remaining should be the
           -- ones which map to a real machine register on this
@@ -1053,7 +1058,7 @@ genCCall target dest_regs argsAndHints
             do
                 dflags <- getDynFlagsNat
                 mopExpr <- cmmMakeDynamicReference dflags addImportNat CallReference $
-                              mkForeignLabel functionName Nothing True
+                              mkForeignLabel functionName Nothing True IsFunction
                 let mopLabelOrExpr = case mopExpr of
                         CmmLit (CmmLabel lbl) -> Left lbl
                         _ -> Right mopExpr