summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CodeGen/Platform.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen/CodeGen/Platform.hs')
-rw-r--r--compiler/codeGen/CodeGen/Platform.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/codeGen/CodeGen/Platform.hs b/compiler/codeGen/CodeGen/Platform.hs
index 66e8f85aff..2ed99833a9 100644
--- a/compiler/codeGen/CodeGen/Platform.hs
+++ b/compiler/codeGen/CodeGen/Platform.hs
@@ -1,5 +1,5 @@
-module CodeGen.Platform (callerSaves, activeStgRegs) where
+module CodeGen.Platform (callerSaves, activeStgRegs, haveRegBase) where
import CmmExpr
import Platform
@@ -50,3 +50,18 @@ activeStgRegs platform
| otherwise -> NoRegs.activeStgRegs
+haveRegBase :: Platform -> Bool
+haveRegBase platform
+ = case platformArch platform of
+ ArchX86 -> X86.haveRegBase
+ ArchX86_64 -> X86_64.haveRegBase
+ ArchSPARC -> SPARC.haveRegBase
+ ArchARM {} -> ARM.haveRegBase
+ arch
+ | arch `elem` [ArchPPC, ArchPPC_64] ->
+ case platformOS platform of
+ OSDarwin -> PPC_Darwin.haveRegBase
+ _ -> PPC.haveRegBase
+
+ | otherwise -> NoRegs.haveRegBase
+