Conversation
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16225 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
- Removed MacOS X support, long dead. - Added support for PowerPC 64 bits, big-endian, ELF v1 ABI (tested, mostly works, some issues remain with marshaling of code pointers) - Added support for PowerPC 64 bits, little-endian, ELF v2 ABI (completely untested) git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
PPC: add some CFI directives and a bit of debug info. testsuite/tests/asmcomp/power.S: update for PPC64le. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16227 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…nk" (default) mode. This is not absolutely necessary, since the dynamic loader is able to relocate non-plt "bl" instructions. However, it avoids problems with direct "bl" instructions that overflow the limited excursion of this instruction (+/- 16 Mbytes). Also, the static linker is clever enough to optimize @plt calls into normal calls when they are within the same static executable or the same DLL. So, there should be no overhead in the static linking case. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16228 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…y maintained when executable has multiple TOCs. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16230 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…slightly smaller code. Plus: force 2^12 alignment of the .opd section so that no page is common to the .opd and the .data sections. This causes output_value and other polymorphic primitives to misbehave. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16236 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
on POWER8. - PPC64: concatenate jump tables so as to reduce the number of TOC entries for jump table labels. - Use simpler asm directives for filling the TOC. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16297 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16298 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16300 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16301 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16319 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16322 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Contributor
Author
|
I forgot to mention performance and optimizations. The proposed code tries (but not very hard) to generate instruction sequences appropriate for instruction fusion on POWER8. Static basic-block instruction scheduling is still based on PPC G3 instruction timings, but this should not make much difference for out-of-order processors like POWER8. If there is a document comparable to "The PowerPC compiler writer's guide" that covers POWER8, I'm interested in reading it. |
…ea before calls to C functions. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16339 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16340 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
On a Power7/RHEL6.4 machine, misalignment of the .data section was observed. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16341 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Contributor
Author
ocamlopt -pack can create large .o files that can easily overflow the 16-bit TOC model. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
|
There is no Compiler Writer's Guide for POWER8, but the POWER8 processor manual is available. |
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16363 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Contributor
Author
|
Merged on trunk, SVN revision 16374. |
This was referenced Mar 14, 2019
stedolan
added a commit
to stedolan/ocaml
that referenced
this pull request
Feb 20, 2020
Use C11 atomics to enforce the OCaml memory model.
mshinwell
added a commit
to mshinwell/ocaml
that referenced
this pull request
Jul 30, 2020
lthls
pushed a commit
to lthls/ocaml
that referenced
this pull request
Sep 23, 2020
lthls
pushed a commit
to lthls/ocaml
that referenced
this pull request
Sep 23, 2020
lthls
pushed a commit
to lthls/ocaml
that referenced
this pull request
Sep 24, 2020
chambart
pushed a commit
to chambart/ocaml-1
that referenced
this pull request
Oct 5, 2021
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
Co-authored-by: Anil Madhavapeddy <anil@recoil.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on bug report 6943, this pull request provides native-code compilation support for the POWER/PowerPC architecture in 64-bit mode, both in big-endian (
ppc64in Debian's classification) and in little-endian (ppc64le).Summary of changes
Starting with the existing
powerport of ocamlopt, which supports PPC32/Linux, PPC32/MacOSX and PPC64/MacOSX, this PR:.locand.cfidirectives), and@pltrelocations for semi-position-independent code (working around the limited excursion of the "branch and link" instruction).ppc6464-bit, big-endian configuration.ppc64le64-bit, little-endian configuration.Comparison with RedHat's ports
RedHat already provides OCaml ports for
ppc64andppc64le, developed in-house and/or in cooperation with IBM. Those ports were an excellent source of inspiration for the proposed code, explaining some of the subtleties of the ELF PPC64 ABIs. The proposed code significantly departs from RedHat's on three points:asmcomp/power,asmcomp/power64andasmcomp/power64le, with copious duplication of code between these three directories. This is not maintainable in the long term. In contrast, the proposed code is one unified architecture, inasmcomp/power, and uses the "model" configuration variable to adapt between 32 and 64 bits, between big and little endian, and between the various ABIs. Code is factored out as much as possible..cfidirectives are generated to enable GDB to walk the call stack as usual.bl function_symbol; nopidiom to call known OCaml functions, using more expensive indirect calls instead. (The idiom is specially optimized by the linker.) This is probably due to problems with tail calls. The proposed code solves these problems differently, using explicit saving and restoring of the TOC registerr2, in a way that remains compatible with the idiom and its link-time optimization.Status and testing
The new port, in its 3 configurations (ppc, ppc64, ppc64le), was tested under Debian 8.1, on a G5 PowerMac at Inria for the ppc and ppc64 configurations, and on a POWER8 virtual machine provided by RedHat Brno for the ppc64le configuration.
All tests from the OCaml test suite pass except one socket-related test that fails on the POWER8 VM, very probably because the VM is IPv6-only and the test is not IPv6-ready.
gprof-style profiling (ocamlopt -p) currently does not work on ppc64le, but it does not work with GCC either. I suspect a problem within Glibc, and reported it to Debian (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794222).The 32 and 64be configurations were also successfully tested on the CompCert compiler.
Maintainability
As a member of the OCaml core dev team, I should be able to support this port in the medium to long term, provided
I am looking into the possibility of adding the PowerMac G5 to our continuous integration system.