-
Notifications
You must be signed in to change notification settings - Fork 73
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
Enable MSA on MIPS64 CI #18
Comments
Clearly an LLVM bug of some kind. Unfortunately I don't work on MIPS anymore and I have no time to investigate it. I'll try and contact someone who may be able to help... |
Hi @gnzlbg . One question. Which version of rust were you using? |
@draganmladjenovic rust nightly |
This boils down to |
Yes, that is ok (we already do this for other targets so it should only be a matter of adding some more |
Ok, thank you for that . I will submit the llvm bug report shortly so you can reference it. |
Thanks, just post that here, and I'll recycle/rename this issue to keep on tracking that LLVM bug. |
Bug submitted at https://bugs.llvm.org/show_bug.cgi?id=38287. |
Thanks! So I think I've made some progress in that things now compile, but they fail to link when using
|
@draganmladjenovic one thing I forgot mentioned is that as #41 shows, the LLVM error is only triggered if MSA is activated. Without MSA, the experimental reduction min/max intrinsics are lowered correctly. |
Huh this is messy. I'm guessing that you are targeting mips64r6 because qemu-mips64 supports MSA only for I6400. The problem is that mips64r6 is not compatible with previous ISA iterations an cannot be linked together. I guess you would need the something akin to mips64dsp2 target, named mips64msa or something. The nan2008 error is because mips64r6 is nan2008 by default. Speaking of nan2008, if remember correctly the qemu-mips for cpu P5600 won't accept non nan2008 binaries, so probably there will be issues with running mips32r5 MSA. I have a vague memory that kernel will allow legacy nan binaries to be run on P5600 under some compatibility option, so mips32r2, MSA binary should be a valid usecase. Not sure what to do here. I guess that I could fork the qemu and provide changes needed. Is using prebuilt binaries a option. It will take some time before this changes end up in debian qemu package.
|
IIRC qemu-mips should support MSA with mips32r5, but in qemu-mips64 MSA is only available for mips64r6.
I think that the problem here is that I am trying to link But from the rest of your comment, I think that I misunderstood the issue.
Which changes do you mean? I'd guess that if qemu supported MSA for |
No no that's it. I think you can install *-mipsisa64r6el-linux-gnuabi64, libc6-dev-mips64r6-cross etc. But in the end for it to work the whole std crate needs to be recompiled because mips64r2 is binary incompatible with mips64r6.
I meant adding support for mips64r5 with MSA (at first glance it looks easy).
I guess. I think that using mips64r6 requires a new target definition for rustc [mipsisa64r6{el}-linux-gnuabi64]. |
Ah! Crap. I see what you mean now.
We should do this anyways. Do you want to open an issue about this in rust-lang/rust and cross-reference it from here, or shall I do that?
That would be cool. I'd prefer for your patch to be merged in qemu upstream. I can then fetch qemu from source/nightly and use that in the Docker containers, and then we can switch to the latest ubuntu version in those when the changes make it into a release. |
I would be very grateful if you do that.
Is using a github fork a valid stopgap option until changes get to qemu upstream? |
Yes, that would be fine. Ideally we would just upload a Docker container with the fork pre-compiled somewhere, so that we don't have to fetch it and compile it on every travis run, but that can be done.
Done: rust-lang/rust#52666 |
Hi I've talked to some people about this issue. Short story: For mips32 the story is a bit complicated. It turns out that NAN2008 (target-feature="+nan2008") is hard requirement for MSA hardware along with FR=1 (target-feature="+fp64"), albeit not enforced by the compiler. When object is build with nan2008, it the taged as such and it is link incompatible with non-nan2008 objects. (There where some plans to make this more lax, but nothing is accepted into upstream binutils so far). The Debian doesn't ship the nan2008 mips cross toolchain nor it provides nan2008 package builds. I was able to test a mips32r5 + MSA board and they seem to usually run with kernel option which disables checking of nan2008 flag allowing prebuilt non-nan2008 RFS to be run on them. So defing mips32r5 + MSA - NAN2008 target for QEMU is out of option, but the providing the option for qemu-usermode to disable nan2008 flag checking might be accepted upstream. Otherwise we would need use custom mips32 target with rebuilt sysroot for nan2008. |
What would need to be done to support a mips64r6 target in rustc upstream, and to be able to test the resulting binaries in qemu ? Is there maybe a cross-compilation toolchain that we could use for that? |
Hi, |
Yes, that toolchain should work. Is there a Dockerimage containing the toolchain somewhere? If not, we can probably just download it in the mips64 Dockerimages and use it. |
Hi @gnzlbg, |
Enabling MSA for the mips64 targets produces the following error:
cc @jcowgill
The text was updated successfully, but these errors were encountered: