summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2018-12-28 23:52:31 +0100
committerBen Gamari <ben@well-typed.com>2019-01-17 13:39:40 -0500
commit64020feaee79aa27716aa9cb0cd457d8c8394682 (patch)
tree21a45a440dabd6a95b409384f4e153d43a09bad6
parentb684675ae14dfacc1dbd845bfff6333adfeee0bb (diff)
downloadhaskell-64020feaee79aa27716aa9cb0cd457d8c8394682.tar.gz
PPC NCG: Make calling convention more general
All operating systems except AIX and Darwin follow the ELF specification.
-rw-r--r--compiler/nativeGen/PPC/CodeGen.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index bbc34117bb..5586e0e958 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -1570,13 +1570,12 @@ data GenCCallPlatform = GCPLinux | GCPLinux64ELF !Int | GCPAIX
platformToGCP :: Platform -> GenCCallPlatform
platformToGCP platform = case platformOS platform of
- OSLinux -> case platformArch platform of
- ArchPPC -> GCPLinux
- ArchPPC_64 ELF_V1 -> GCPLinux64ELF 1
- ArchPPC_64 ELF_V2 -> GCPLinux64ELF 2
- _ -> panic "PPC.CodeGen.platformToGCP: Unknown Linux"
OSAIX -> GCPAIX
- _ -> panic "PPC.CodeGen.platformToGCP: not defined for this OS"
+ _ -> case platformArch platform of
+ ArchPPC -> GCPLinux
+ ArchPPC_64 ELF_V1 -> GCPLinux64ELF 1
+ ArchPPC_64 ELF_V2 -> GCPLinux64ELF 2
+ _ -> panic "platformToGCP: Not PowerPC"
genCCall'