Document CmmZipUtil
[ghc-hetmet.git] / compiler / cmm / CLabel.hs
index cb07d06..0c3c007 100644 (file)
@@ -90,6 +90,7 @@ module CLabel (
 
        mkForeignLabel,
         addLabelSize,
+        foreignLabelStdcallInfo,
 
        mkCCLabel, mkCCSLabel,
 
@@ -372,6 +373,10 @@ addLabelSize (ForeignLabel str _ is_dynamic) sz
 addLabelSize label _
   = label
 
+foreignLabelStdcallInfo :: CLabel -> Maybe Int
+foreignLabelStdcallInfo (ForeignLabel _ info _) = info
+foreignLabelStdcallInfo _lbl = Nothing
+
        -- Cost centres etc.
 
 mkCCLabel      cc              = CC_Label cc
@@ -495,8 +500,16 @@ isMathFun (ForeignLabel fs _ _) = fs `elem` math_funs
         (fsLit "cosf"),   (fsLit "tanf"),  (fsLit "sinhf"),
         (fsLit "coshf"),  (fsLit "tanhf"), (fsLit "asinf"),
         (fsLit "acosf"),  (fsLit "atanf"), (fsLit "logf"),
-        (fsLit "expf"),   (fsLit "sqrtf")
-   ]
+        (fsLit "expf"),   (fsLit "sqrtf"), (fsLit "frexp"),
+        (fsLit "modf"),   (fsLit "ilogb"), (fsLit "copysign"),
+        (fsLit "remainder"), (fsLit "nextafter"), (fsLit "logb"),
+        (fsLit "cbrt"),   (fsLit "atanh"), (fsLit "asinh"),
+        (fsLit "acosh"),  (fsLit "lgamma"),(fsLit "hypot"),
+        (fsLit "erfc"),   (fsLit "erf"),   (fsLit "trunc"),
+        (fsLit "round"),  (fsLit "fmod"),  (fsLit "floor"),
+        (fsLit "fabs"),   (fsLit "ceil"),  (fsLit "log10"),
+        (fsLit "ldexp"),  (fsLit "atan2"), (fsLit "rint")
+    ]
 isMathFun _ = False
 
 -- -----------------------------------------------------------------------------
@@ -515,6 +528,8 @@ externallyVisibleCLabel (PlainModuleInitLabel _)= True
 externallyVisibleCLabel ModuleRegdLabel    = False
 externallyVisibleCLabel (RtsLabel _)      = True
 externallyVisibleCLabel (ForeignLabel _ _ _) = True
+externallyVisibleCLabel (IdLabel name SRT)   = False
+                         -- SRTs don't need to be external
 externallyVisibleCLabel (IdLabel name _)     = isExternalName name
 externallyVisibleCLabel (CC_Label _)      = True
 externallyVisibleCLabel (CCS_Label _)     = True