CI for MIPS/MIPS64
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 694
- Forks
- 336
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 9
Description
To test the MIPS SIMD Architecture (MSA) intrinsics we need to setup CI for MIPS/MIP64 targets. This is a summary of the problems I've encountered so far.
-
using MSA requires enabling floating-point features (
fp64/fpxx). The current 32-bit MIPS targets ({mips,mipsel}-unknown-linux-gnu) do not have these enabled. Passing-C target-feature=+msa,+fp64does not help:LLVM ERROR: MSA requires a 64-bit FPU register file (FR=1 mode). See -mattr=+fp64. -
enabling floating point probably will require a std library compiled with it enabled, this should help: https://github.com/rust-lang/rust/pull/48874
-
qemu only supports two CPUs with MSA: p5600 (32-bit) and i6400 (64-bit).
-
qemu has a bug in which the auxiliary vector bit for MSA is not set: https://bugs.launchpad.net/qemu/+bug/1754372 ; until that is fixed we can't really test run-time feature detection under qemu and must override it to test the intrinsics
-
cross-compiling for
i6400is challenging. We need to set-C target-cpu=mips64r6when compiling Rust. This is going to require thestdlib to be compiled for this. Also, we need to set-march=mips64r6when compiling C (e.g. for backtrace, auxv, etc.). The cross-compilation toolchains for this are not available in Ubuntu, only on Debian testing/unstable:libc6-dev-mips64r-cross. I haven't managed to get them to work (they seem buggy: missing headers, linking failurs, etc. they do not work out-of-the-box). One also must be careful of not cross-compiling against code that was compiled formips64r2since that will fail to link. All in all we might need to just use a different toolchain here, like the Codescape SDK. This explains how to set it up: https://github.com/v8mips/v8mips/wiki/Building-v8-for-MIPS -
cross-compiling for
p5600requires targeting-C target-cpu=mips64r5/-march=mips64r5. The toolchains for it look mature, they might even work out-of-the-box. We will probably still need to recompile the std library for these targets though.
I would be surprised if these were the only issues.
In my opinion, the most promising route towards CI for MS would be to focus on mips/mipsel and the p5600.
cc @jcowgill @malbarbo @japaric
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by evaluating the proposed mips/mipsel and p5600 route, including Rust std compilation, target CPU flags, QEMU's p5600/i6400 support, and available cross-toolchains. Done means a reproducible CI job builds and runs MSA intrinsic tests on a supported target, with runtime feature detection handled around QEMU's auxiliary-vector bug.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 22/100