-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
32-bit mips target emits 64-bit instructions #104985
Comments
Hmm, so I looked up the ISA version you mentioned with a quick search and
I am an expert on many other architectures and not so much on MIPS. Yet I feel uncertain if you are asking for what you actually want and want to make sure if that is indeed what you meant to ask for? |
You may be right, and that it's not so much the CPU as the system which has made the choice to not enable the 64-bit instructions, even though my CPU supports them. Back to the drawing board. |
According to |
Ah, so this is an insufficiency in LLVM's MIPS support? Then it can be reported upstream, but we're probably not going to make progress on fixing this here. Neither do we need to close it, however, as we can still track the issue until LLVM does fix it (or until it gets closed by something else, like e.g. implementing sufficient libgccjit support so people can get this by other means). |
My initial thought is just to use a truly 32-bit-only CPU for the target definition instead, but yeah this would be the ultimate fix. |
Hmm, apparently a similar request was already vocalized but has been marked "wontfix", though its not clear if its an exact match or what the reason why was: llvm/llvm-project#18632 Eesh. I suppose you could ask them to reconsider. |
It's fixed. |
Not committed to HEAD yet. But when that changeset is accepted, we can accept a PR doing the requisite plumbing to allow defining a |
It has been merged, in a RC of LLVM 17. |
Cool, that'll probably be in #114048 then. |
I am initially a little hesitant to characterize this as a bug, or whether it is just me asking for help...
I recently added support for the
mipsel-unknown-netbsd
target to our rust package in our pkgsrc-wip github repository, and based on this I managed to cross-build a bootstrap kit for that target. However, the resulting binaries fail to run on NetBSD's 32-bit ports, which use o32 ABI and have in general turned off support for 64-bit instructions.The target spec calls for emitting instructions adhering to "mips3", which I think excludes any 64-bit instructions; the
rustc
target spec looks like this:However, despite this, we end up with 64-bit-only instructions in the output, ref.
and trying to run it results in an "Illegal Instruction" signal and a core dump.
Now, I'm also not certain exactly what to blame, whether it's LLVM itself, or the coupling between rustc and LLVM.
Anyway, hints to get this fixed would be much appreciated.
Oh, yes, this is with code based on rust 1.65.0.
The text was updated successfully, but these errors were encountered: