-
Notifications
You must be signed in to change notification settings - Fork 289
Build failure on s390x #498
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
Comments
(Well it has to be #467 because the symbol |
So this is weird. Is anything else failing there beyond s390x ? |
travis aborts early if there is a build failure. So the other jobs are all shown as interrupted: https://travis-ci.org/rust-lang/rust/builds/396479389 |
This codegen test works on s390x: https://github.com/rust-lang/rust/blob/master/src/test/codegen/simd-intrinsic-float-abs.rs#L68 but probably doesn't lower anything down to s390x. This test doesn't cover that particular case: https://github.com/rust-lang/rust/blob/master/src/test/run-pass/simd-intrinsic-float-math.rs#L25 MWE (EDIT: does not produce the same error, see below): #![feature(link_llvm_intrinsics, repr_simd, simd_ffi)]
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.fabs.v4f32"]
fn abs_v4f32(x: F32x4) -> F32x4;
}
#[repr(simd)]
pub struct F32x4(
f32, f32, f32, f32,
);
pub unsafe fn foo(x: F32x4) -> F32x4 { abs_v4f32(x) } fails to compile for s390x-unknown-linux-gnu with: Intrinsic has incorrect return type!
void (<4 x float>*, <4 x float>*)* @llvm.fabs.v4f32
LLVM ERROR: Broken function found, compilation aborted! That error is different than the one being reported :/ The following LLVM-IR is generated: define void @ttt::foo(<4 x float>* noalias nocapture sret dereferenceable(16), <4 x float>* noalias nocapture readonly dereferenceable(16) %x) unnamed_addr #0 {
start:
%1 = load <4 x float>, <4 x float>* %x, align 16
%2 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %1)
store <4 x float> %2, <4 x float>* %0, align 16
ret void
} which on godbolt works for s390x just fine: https://godbolt.org/g/hG54Vv emits: foo: # @foo
le %f0, 0(%r3)
le %f1, 4(%r3)
le %f2, 8(%r3)
le %f3, 12(%r3)
lpdfr %f0, %f0
lpdfr %f1, %f1
lpdfr %f2, %f2
lpdfr %f3, %f3
ste %f3, 12(%r2)
ste %f2, 8(%r2)
ste %f1, 4(%r2)
ste %f0, 0(%r2)
br %r14 |
Looking more closely at the upstream error: Intrinsic has incorrect return type!
[00:25:19] void (<16 x float>*, <16 x float>*)* @llvm.fabs.v16f32 It appears that the vector types are being passed via memory when calling the llvm intrinsics directly via |
https://github.com/rust-lang/rust/pull/47743/files#diff-7977ffa598a44c353febcd69a0415479R894 That doesn't use the in memory abi if the ABI is the platform intrinsics ABI, but maybe it shouldn't use it either if we are calling llvm intrinsics directly via |
Modifying the ABI depending on some attribute on the function in question might get ugly, I don't think any attributes currently influence ABI calculation. But @eddyb would know better. |
@nagisa should know what to do here, since I believe they dealt with this before. |
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
For i128 we implemented a separate extern that did exactly what we needed
on the platform IIRC.
…On Mon, Jun 25, 2018, 22:36 Eduard-Mihai Burtescu ***@***.***> wrote:
@nagisa <https://github.com/nagisa> should know what to do here, since I
believe they dealt with this before.
I personally think link_llvm_intrinsics is a bad idea overall, and quite
unsustainable, but YMMV.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#498 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0ixj3PfuzZ7fwbnwcuG0UnWEeDSVks5uATuugaJpZM4U2nJS>
.
|
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
…perations. I've opened rust-lang#501 to track the workarounds introduced here. Closes rust-lang#498.
(FWIW I found what I was remembering: |
I've tried to update the stdsimd module in rust, but got this build failure:
According to @kennytm a likely cause was #467
The text was updated successfully, but these errors were encountered: