SPARC NCG: Split up into chunks, and fix warnings.
[ghc-hetmet.git] / compiler / nativeGen / X86 / Ppr.hs
index 3f181fc..4881062 100644 (file)
@@ -43,7 +43,9 @@ import Outputable     (panic, Outputable)
 
 import Data.Word
 
-
+#if i386_TARGET_ARCH && darwin_TARGET_OS
+import Data.Bits
+#endif
 
 -- -----------------------------------------------------------------------------
 -- Printing this stuff out
@@ -96,7 +98,13 @@ pprData :: CmmStatic -> Doc
 pprData (CmmAlign bytes)         = pprAlign bytes
 pprData (CmmDataLabel lbl)       = pprLabel lbl
 pprData (CmmString str)          = pprASCII str
+
+#if  darwin_TARGET_OS
+pprData (CmmUninitialised bytes) = ptext (sLit ".space ") <> int bytes
+#else
 pprData (CmmUninitialised bytes) = ptext (sLit ".skip ") <> int bytes
+#endif
+
 pprData (CmmStaticLit lit)       = pprDataItem lit
 
 pprGloblDecl :: CLabel -> Doc
@@ -301,6 +309,7 @@ pprSize x
 #elif x86_64_TARGET_ARCH
                FF32  -> sLit "ss"      -- "scalar single-precision float" (SSE2)
                FF64  -> sLit "sd"      -- "scalar double-precision float" (SSE2)
+                _     -> panic "X86.Ppr.pprSize: no match"
 #else
                _     -> panic "X86.Ppr.pprSize: no match"
 #endif
@@ -379,7 +388,7 @@ pprSectionHeader seg
        RelocatableReadOnlyData -> ptext (sLit ".const_data\n.align 2")
        UninitialisedData       -> ptext (sLit ".data\n\t.align 2")
        ReadOnlyData16          -> ptext (sLit ".const\n.align 4")
-       OtherSection sec        -> panic "X86.Ppr.pprSectionHeader: unknown section"
+       OtherSection _          -> panic "X86.Ppr.pprSectionHeader: unknown section"
 
 #    else
 pprSectionHeader seg
@@ -390,7 +399,7 @@ pprSectionHeader seg
        RelocatableReadOnlyData -> ptext (sLit ".section .data\n\t.align 4")
        UninitialisedData       -> ptext (sLit ".section .bss\n\t.align 4")
        ReadOnlyData16          -> ptext (sLit ".section .rodata\n\t.align 16")
-       OtherSection sec        -> panic "X86.Ppr.pprSectionHeader: unknown section"
+       OtherSection _          -> panic "X86.Ppr.pprSectionHeader: unknown section"
 
 #    endif
 
@@ -404,7 +413,7 @@ pprSectionHeader seg
        RelocatableReadOnlyData -> ptext (sLit ".const_data\n.align 3")
        UninitialisedData       -> ptext (sLit ".data\n\t.align 3")
        ReadOnlyData16          -> ptext (sLit ".const\n.align 4")
-       OtherSection sec        -> panic "PprMach.pprSectionHeader: unknown section"
+       OtherSection _          -> panic "PprMach.pprSectionHeader: unknown section"
 
 #    else
 pprSectionHeader seg
@@ -415,7 +424,7 @@ pprSectionHeader seg
        RelocatableReadOnlyData -> ptext (sLit ".section .data\n\t.align 8")
        UninitialisedData       -> ptext (sLit ".section .bss\n\t.align 8")
        ReadOnlyData16          -> ptext (sLit ".section .rodata.cst16\n\t.align 16")
-       OtherSection sec        -> panic "PprMach.pprSectionHeader: unknown section"
+       OtherSection _          -> panic "PprMach.pprSectionHeader: unknown section"
 
 #    endif