[commit: ghc] wip/T15916: PPC NCG: Make calling convention more general (8d12a69)

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:08:42 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T15916
Link       : http://ghc.haskell.org/trac/ghc/changeset/8d12a6929fa08eb136506abeaa4e3dd47ccb1716/ghc

>---------------------------------------------------------------

commit 8d12a6929fa08eb136506abeaa4e3dd47ccb1716
Author: Peter Trommler <ptrommler at acm.org>
Date:   Fri Dec 28 23:52:31 2018 +0100

    PPC NCG: Make calling convention more general
    
    All operating systems except AIX and Darwin follow the ELF
    specification.


>---------------------------------------------------------------

8d12a6929fa08eb136506abeaa4e3dd47ccb1716
 compiler/nativeGen/PPC/CodeGen.hs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index bbc3411..5586e0e 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'



More information about the ghc-commits mailing list