Add powerpc64le Linux support#979
Conversation
|
Is |
|
Yes, powerpc64 is big endian. We hope to get big endian working, but for now are concentrating on the little endian port (powerpc64le). |
include/swift/Runtime/Metadata.h
Outdated
There was a problem hiding this comment.
Is __powerpc64__ defined on BE, LE or both?
There was a problem hiding this comment.
It is defined on both BE and LE targets:
$ uname -m
ppc64le
$ cpp -dM < /dev/null | grep __powerpc64__
#define __powerpc64__ 1
$ uname -m
ppc64
$ cpp -dM < /dev/null | grep __powerpc64__
#define __powerpc64__ 1
There was a problem hiding this comment.
The comment above this block says that lib/IRGen/SwiftTargetInfo.cpp needs adjustments (you need to add a configurePowerPC function there).
|
How far does this patch allows the port to go? Does the standard library build? Does hello world work? Do the tests run? |
|
The powerpc64le port builds and runs the test suite with a few failures: And hello world works: |
|
@antonblanchard I'm really impressed! |
|
Did you try the validation test suite |
|
Thanks, that's given me a few more failing tests to sort out: |
|
Again, very impressed it is just 8 tests in total! |
|
Yes, I'm surprised by how clean the port is. Having the compiler written in c++ (vs the target language), and pulling in clang to get the ABI parameter passing rules helps. Other LLVM based languages have required a lot more work. Big endian still requires work, but we can attack that once the little endian port is solid. |
|
I'm not sure of the preferred workflow, but I'm happy to rebase and squash these commits. |
There was a problem hiding this comment.
Please keep the unsupported error so that we get a loud error for new architectures. Just add an explicit #elseif arch(powerpc64) for BE (here and below).
|
Yes, we prefer rebasing/squashing. |
1e3c7fb to
8ce2507
Compare
There was a problem hiding this comment.
This part needs a test like test/BuildConfigurations/x64LinuxTarget.swift for each supported triple.
There was a problem hiding this comment.
Thanks, will add these tests
|
@antonblanchard Thank you! Looks good, but I have two more comments. |
|
Very cool, thank you for working on adding this! |
This patch adds powerpc64le Linux support. While the patch also adds the matching powerpc64 bits, there are endian issues that need to be sorted out. The PowerPC LLVM changes for the swift ABI (eg returning three element non-homogeneous aggregates) are still in the works, but a simple LLVM fix to allow those aggregates results in swift passing all but 8 test cases.
8ce2507 to
b1827d8
Compare
|
@antonblanchard The ObjC values should be dynamically dead as far as I understand. If you find they are also statically unused -- feel free to remove them! |
|
I ran tests on Ubuntu 14.04 x86_64 and OS X, and see no regressions. Merging. Thank you! |
Add powerpc64le Linux support
This patch adds powerpc64le Linux support. While the patch also adds
the matching powerpc64 bits, there are endian issues that need to be
sorted out.
The PowerPC LLVM changes for the swift ABI (eg returning three element
non-homogeneous aggregates) are still in the works, but a simple LLVM
fix to allow those aggregates results in swift passing all but 8
test cases.
Note: It would be nice if swift had conditional compilation based on pointer size, a
number of the test cases only care if the target is 32 or 64 bit.