diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cmm/PprC.hs | 1 | ||||
-rw-r--r-- | compiler/codeGen/CodeGen/Platform.hs | 6 | ||||
-rw-r--r-- | compiler/codeGen/CodeGen/Platform/ARM64.hs | 8 | ||||
-rw-r--r-- | compiler/ghc.cabal.in | 1 | ||||
-rw-r--r-- | compiler/ghc.mk | 1 | ||||
-rw-r--r-- | compiler/llvmGen/Llvm/PpLlvm.hs | 2 | ||||
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/Ppr.hs | 3 | ||||
-rw-r--r-- | compiler/main/DriverPipeline.hs | 1 | ||||
-rw-r--r-- | compiler/utils/Platform.hs | 1 |
9 files changed, 23 insertions, 1 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs index 9502d34378..23d23ff9bb 100644 --- a/compiler/cmm/PprC.hs +++ b/compiler/cmm/PprC.hs @@ -1088,6 +1088,7 @@ cLoad expr rep bewareLoadStoreAlignment ArchMipseb = True bewareLoadStoreAlignment ArchMipsel = True bewareLoadStoreAlignment (ArchARM {}) = True + bewareLoadStoreAlignment ArchARM64 = True -- Pessimistically assume that they will also cause problems -- on unknown arches bewareLoadStoreAlignment ArchUnknown = True diff --git a/compiler/codeGen/CodeGen/Platform.hs b/compiler/codeGen/CodeGen/Platform.hs index ca3bafb8de..e44eed67cb 100644 --- a/compiler/codeGen/CodeGen/Platform.hs +++ b/compiler/codeGen/CodeGen/Platform.hs @@ -9,6 +9,7 @@ import Platform import Reg import qualified CodeGen.Platform.ARM as ARM +import qualified CodeGen.Platform.ARM64 as ARM64 import qualified CodeGen.Platform.PPC as PPC import qualified CodeGen.Platform.PPC_Darwin as PPC_Darwin import qualified CodeGen.Platform.SPARC as SPARC @@ -28,6 +29,7 @@ callerSaves platform ArchX86_64 -> X86_64.callerSaves ArchSPARC -> SPARC.callerSaves ArchARM {} -> ARM.callerSaves + ArchARM64 -> ARM64.callerSaves arch | arch `elem` [ArchPPC, ArchPPC_64] -> case platformOS platform of @@ -50,6 +52,7 @@ activeStgRegs platform ArchX86_64 -> X86_64.activeStgRegs ArchSPARC -> SPARC.activeStgRegs ArchARM {} -> ARM.activeStgRegs + ArchARM64 -> ARM64.activeStgRegs arch | arch `elem` [ArchPPC, ArchPPC_64] -> case platformOS platform of @@ -67,6 +70,7 @@ haveRegBase platform ArchX86_64 -> X86_64.haveRegBase ArchSPARC -> SPARC.haveRegBase ArchARM {} -> ARM.haveRegBase + ArchARM64 -> ARM64.haveRegBase arch | arch `elem` [ArchPPC, ArchPPC_64] -> case platformOS platform of @@ -84,6 +88,7 @@ globalRegMaybe platform ArchX86_64 -> X86_64.globalRegMaybe ArchSPARC -> SPARC.globalRegMaybe ArchARM {} -> ARM.globalRegMaybe + ArchARM64 -> ARM64.globalRegMaybe arch | arch `elem` [ArchPPC, ArchPPC_64] -> case platformOS platform of @@ -101,6 +106,7 @@ freeReg platform ArchX86_64 -> X86_64.freeReg ArchSPARC -> SPARC.freeReg ArchARM {} -> ARM.freeReg + ArchARM64 -> ARM64.freeReg arch | arch `elem` [ArchPPC, ArchPPC_64] -> case platformOS platform of diff --git a/compiler/codeGen/CodeGen/Platform/ARM64.hs b/compiler/codeGen/CodeGen/Platform/ARM64.hs new file mode 100644 index 0000000000..c3ebeda6bf --- /dev/null +++ b/compiler/codeGen/CodeGen/Platform/ARM64.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE CPP #-} + +module CodeGen.Platform.ARM64 where + +#define MACHREGS_NO_REGS 0 +#define MACHREGS_aarch64 1 +#include "../../../../includes/CodeGen.Platform.hs" + diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 6422eb7ce9..46fdb40369 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -219,6 +219,7 @@ Library Bitmap CodeGen.Platform CodeGen.Platform.ARM + CodeGen.Platform.ARM64 CodeGen.Platform.NoRegs CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin diff --git a/compiler/ghc.mk b/compiler/ghc.mk index fb8aa730e8..c5b58e90b0 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -614,6 +614,7 @@ compiler_stage2_dll0_MODULES += \ CmmUtils \ CodeGen.Platform \ CodeGen.Platform.ARM \ + CodeGen.Platform.ARM64 \ CodeGen.Platform.NoRegs \ CodeGen.Platform.PPC \ CodeGen.Platform.PPC_Darwin \ diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index 73077257f8..cdc407c152 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -80,7 +80,7 @@ ppLlvmGlobal (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) = const_link = case c of Global -> ppr link <+> text "global" Constant -> ppr link <+> text "constant" - Alias -> text "alias" <+> ppr link + Alias -> ppr link <+> text "alias" in ppAssignment var $ const_link <+> rhs <> sect <> align $+$ newLine diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs index 80e8949ac8..3b5cbbf632 100644 --- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs +++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs @@ -65,6 +65,9 @@ moduleLayout = sdocWithPlatform $ \platform -> Platform { platformArch = ArchX86, platformOS = OSiOS } -> text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32\"" $+$ text "target triple = \"i386-apple-darwin11\"" + Platform { platformArch = ArchARM64, platformOS = OSiOS } -> + text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32:64-S128\"" + $+$ text "target triple = \"arm64-apple-ios7.0.0\"" _ -> -- FIX: Other targets empty diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index ed2e906676..eefa0a6ba3 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1934,6 +1934,7 @@ linkBinary' staticLink dflags o_files dep_packages = do ArchX86 -> True ArchX86_64 -> True ArchARM {} -> True + ArchARM64 -> True _ -> False then ["-Wl,-no_compact_unwind"] else []) diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs index ca8f0de862..39903eacb3 100644 --- a/compiler/utils/Platform.hs +++ b/compiler/utils/Platform.hs @@ -61,6 +61,7 @@ data Arch isARM :: Arch -> Bool isARM (ArchARM {}) = True +isARM ArchARM64 = True isARM _ = False -- | Operating systems that the native code generator knows about. |