summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CodeGen/Platform.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-21 18:44:31 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-21 18:44:31 +0100
commit15856e97d3107f75be40588ec2dc8e6d670463fe (patch)
tree71c1e827241d150298c0b7dea412506a5c2f22ae /compiler/codeGen/CodeGen/Platform.hs
parent75700644a7430612b40ba94476a5749594010671 (diff)
downloadhaskell-15856e97d3107f75be40588ec2dc8e6d670463fe.tar.gz
Add haveRegBase to CodeGen.Platform
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
+