summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2018-12-28 23:55:35 +0100
committerBen Gamari <ben@well-typed.com>2019-01-17 13:39:40 -0500
commit539a8f0e23558b8652985049d1c104eb9058171f (patch)
tree18e61b2ee235c05f3c13be6d394d7fc2cb214ed6
parent64020feaee79aa27716aa9cb0cd457d8c8394682 (diff)
downloadhaskell-539a8f0e23558b8652985049d1c104eb9058171f.tar.gz
PPC NCG: Make `stackHeaderSize` more general
-rw-r--r--compiler/nativeGen/PPC/Instr.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/nativeGen/PPC/Instr.hs b/compiler/nativeGen/PPC/Instr.hs
index f8dba25a21..e618e189b8 100644
--- a/compiler/nativeGen/PPC/Instr.hs
+++ b/compiler/nativeGen/PPC/Instr.hs
@@ -582,14 +582,13 @@ ppc_mkLoadInstr dflags reg delta slot
stackFrameHeaderSize :: DynFlags -> Int
stackFrameHeaderSize dflags
= case platformOS platform of
- OSLinux -> case platformArch platform of
- -- header + parameter save area
- ArchPPC -> 64 -- TODO: check ABI spec
- ArchPPC_64 ELF_V1 -> 48 + 8 * 8
- ArchPPC_64 ELF_V2 -> 32 + 8 * 8
- _ -> panic "PPC.stackFrameHeaderSize: Unknown Linux"
OSAIX -> 24 + 8 * 4
- _ -> panic "PPC.stackFrameHeaderSize: not defined for this OS"
+ _ -> case platformArch platform of
+ -- header + parameter save area
+ ArchPPC -> 64 -- TODO: check ABI spec
+ ArchPPC_64 ELF_V1 -> 48 + 8 * 8
+ ArchPPC_64 ELF_V2 -> 32 + 8 * 8
+ _ -> panic "PPC.stackFrameHeaderSize: not defined for this OS"
where platform = targetPlatform dflags
-- | The maximum number of bytes required to spill a register. PPC32