[GHC] #9863: Provide PowerPC 64 bit native code generator
#9863: Provide PowerPC 64 bit native code generator -------------------------------------+------------------------------------- Reporter: trommler | Owner: trommler Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Linux Architecture: powerpc64 | Type of failure: Difficulty: Project (more | None/Unknown than a week) | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- I have started work on a native code generator for PowerPC 64 bit by extending the 32 bit code generator. The code is hosted on github: [https://github.com/trommler/ghc/tree/native] So far I plan to support the old ELF v1.9 ABI on big endian. I might look into little endian and ELF 2.0 later. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: trommler Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Changes (by trommler): * status: new => patch * differential: => Phab:D629 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: trommler Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Changes (by PHO): * cc: PHO (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: trommler Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Changes (by erikd): * cc: erikd (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: trommler Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Comment (by trommler): I have a first attempt at an ELF v2 implementation in my github repository: [https://github.com/trommler/ghc/tree/rebase-May-06]. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: trommler Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Comment (by trommler): I updated Phab:D629 and we now have both ABIs, ELF 1.9 (big endian) and ELF 2 (little endian). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Changes (by trommler): * owner: trommler => -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Comment (by Ben Gamari <ben@…>): In [changeset:"d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984" Implement PowerPC 64-bit native code backend for Linux Extend the PowerPC 32-bit native code generator for "64-bit PowerPC ELF Application Binary Interface Supplement 1.9" by Ian Lance Taylor and "Power Architecture 64-Bit ELF V2 ABI Specification -- OpenPOWER ABI for Linux Supplement" by IBM. The latter ABI is mainly used on POWER7/7+ and POWER8 Linux systems running in little-endian mode. The code generator supports both static and dynamic linking. PowerPC 64-bit code for ELF ABI 1.9 and 2 is mostly position independent anyway, and thus so is all the code emitted by the code generator. In other words, -fPIC does not make a difference. rts/stg/SMP.h support is implemented. Following the spirit of the introductory comment in PPC/CodeGen.hs, the rest of the code is a straightforward extension of the 32-bit implementation. Limitations: * Code is generated only in the medium code model, which is also gcc's default * Local symbols are not accessed directly, which seems to also be the case for 32-bit * LLVM does not work, but this does not work on 32-bit either * Must use the system runtime linker in GHCi, because the GHC linker for "static" object files (rts/Linker.c) for PPC 64-bit is not implemented. The system runtime (dynamic) linker works. * The handling of the system stack (register 1) is not ELF- compliant so stack traces break. Instead of allocating a new stack frame, spill code should use the "official" spill area in the current stack frame and deallocation code should restore the back chain * DWARF support is missing Fixes #9863 Test Plan: validate (on powerpc, too) Reviewers: simonmar, trofi, erikd, austin Reviewed By: trofi Subscribers: bgamari, arnons1, kgardas, thomie Differential Revision: https://phabricator.haskell.org/D629 GHC Trac Issues: #9863 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9863: Provide PowerPC 64 bit native code generator ------------------------------------+------------------------------------ Reporter: trommler | Owner: Type: feature request | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: powerpc64 Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D629 ------------------------------------+------------------------------------ Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Well done trommler! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9863#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC