-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Trying to use MSA instructions on MIPS segfaults LLVM #46310
Comments
You may want to use a build with llvm assertions enabled, it's probably hitting an assert first somewhere |
And now I wish that we had alternate builds for all targets 😆 |
I just tried this with mips64el on Rust nightly and it seems to work.
If you omit the |
Could you try without |
Yeah this works: #![feature(repr_simd, simd_ffi, link_llvm_intrinsics, target_feature)]
#[allow(non_camel_case_types)]
#[repr(simd)]
pub struct i8x16(
i8, i8, i8, i8, i8, i8, i8, i8,
i8, i8, i8, i8, i8, i8, i8, i8
);
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.mips.add.a.b"]
fn msa_add_a_b(a: i8x16, b: i8x16) -> i8x16;
}
#[target_feature(enable = "msa")]
pub unsafe fn foo(a: i8x16) -> i8x16 {
let b = i8x16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
msa_add_a_b(a, b)
} I have a feeling it will only work on 64-bit at the moment though because MSA is not compatible with the default floating point mode on 32-bit (FP32). I think enabling "FPXX" will make it work, but I haven't tested it yet. |
Some context for FPXX: |
I am currently trying with the |
I am trying to set up the MIPS SIMD intrinsics in
stdsimd
and am running into the following segfault:I have tried this example on clang and it appears to work just fine. The only thing clang does is enabling the target feature
msa
(here they call AddTargetFeature, which is defined here).The segfault is:
The text was updated successfully, but these errors were encountered: