[commit: ghc] master: Implement PowerPC 64-bit native code backend for Linux (d3c1dda)
git at git.haskell.org
git at git.haskell.org
Fri Jul 3 17:29:39 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984/ghc
>---------------------------------------------------------------
commit d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984
Author: Peter Trommler <ptrommler at acm.org>
Date: Fri Jul 3 19:09:06 2015 +0200
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
>---------------------------------------------------------------
d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984
aclocal.m4 | 7 +-
compiler/cmm/CLabel.hs | 16 +-
compiler/codeGen/CodeGen/Platform.hs | 10 +-
compiler/nativeGen/AsmCodeGen.hs | 24 +-
compiler/nativeGen/PIC.hs | 83 ++-
compiler/nativeGen/PPC/CodeGen.hs | 673 ++++++++++++++++-----
compiler/nativeGen/PPC/Instr.hs | 92 ++-
compiler/nativeGen/PPC/Ppr.hs | 163 ++++-
compiler/nativeGen/PPC/Regs.hs | 21 +-
compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 8 +-
compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | 2 +-
compiler/nativeGen/RegAlloc/Linear/Main.hs | 2 +-
compiler/nativeGen/TargetReg.hs | 10 +-
compiler/utils/Platform.hs | 13 +-
configure.ac | 2 +-
includes/CodeGen.Platform.hs | 3 +
includes/stg/HaskellMachRegs.h | 3 +-
includes/stg/RtsMachRegs.h | 3 +-
includes/stg/SMP.h | 28 +-
mk/config.mk.in | 10 +-
rts/StgCRun.c | 10 +-
rts/StgCRunAsm.S | 114 ++++
rts/ghc.mk | 3 +
testsuite/tests/rts/all.T | 6 +
24 files changed, 1044 insertions(+), 262 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984
More information about the ghc-commits
mailing list