New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stage2: Fix softfloat support for PPC64(LE) #13100
Conversation
a6fba9a
to
6ae9546
Compare
With these changes, I can now do: $ zig build --prefix $(pwd)/ppc64le -Dtarget=powerpc64le-linux
$ qemu-ppc64le ./ppc64le/bin/zig version
0.10.0-dev.4250+6ed73720a
$ qemu-ppc64le ./ppc64le/bin/zig test test/behavior.zig -I . -I test -target x86_64-linux
853 passed; 562 skipped; 0 failed. The behavior tests also pass (cross-compiling from x86-64): $ zig test test/behavior.zig -I . -I test -target powerpc64le-linux --test-cmd qemu-ppc64le --test-cmd-bin
...
1331 passed; 100 skipped; 0 failed. I haven't gone through the Zig bootstrap process for PPC, so I have not tested the LLVM backend on PowerPC. Likely there are still problems there due to the C ABI being incorrect/unimplemented for PPC. |
3dd648a
to
aa27e4c
Compare
} else if (common.want_aeabi) { | ||
@export(__aeabi_h2f, .{ .name = "__aeabi_h2f", .linkage = common.linkage }); | ||
} else { | ||
@export(__extendhfsf2, .{ .name = "__extendhfsf2", .linkage = common.linkage }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exports the "standard compiler-rt" symbol names on all targets, since this is what stage2 calls for softfloat in the backend.
Let me know if this is wrong - We can make the softfloat calls to the arch-specific ABI instead of re-exporting.
aa27e4c
to
0747b4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Do you want to try enabling PPC64 in test/tests.zig (test_targets
)?
ab69f8a
to
4fd8d93
Compare
All good here. Let's see what the CI thinks. P.S. I almost regressed stage1 on accident with this PR - Might be worth re-enabling behavior tests on CI for stage1 until stage1 is gone, at least for one target. |
954b28e
to
d2a4edf
Compare
This gets the behavior tests passing for stage1 again.
Stage 2's softfloat support still had a couple of gaps, which were preventing us from lowering `f16` on this target. With any luck, this is enough to get PPC64 working as a Tier 2 target again.
This change also exposes some of the existing functions under both the PPC-style names symbols and the compiler-rt-style names, since Zig currently lowers softfloat calls to the latter.
Also, f16 is not supported on this backend.
This instruction is not supported on this backend, so should just be a noop.
060536f
to
3486322
Compare
7e6fc24
to
a168893
Compare
With any luck, this is enough to get PPC64 compiling again.