-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
arm32 support #1173
Comments
There is already an issue for arm64 support: https://github.com/bytecodealliance/cranelift/issues/719. Should this be merged, or is arm32 different enough at instruction encoding or abi level to need a separate issue? |
I don't know much about arm64, but I believe there are some important differences (for example on arm64 NEON supports double precision). However if someone thinks it should be merged, feel free to do it. |
I was referring to which bits represent an instruction. For x86/x86_64 the difference is small. Instructions with 32bit registers are often the same on x86 and x86_64, and the 64bit register variant just needs an extra byte (rex). I don't know if arm has something similar. |
On arm differences are much bigger. Encodings are definitely different. |
arm32 and arm64 are majorly different, both architecturally and at the encoding level. I'd suggest that attempts to unify them will lead to big problems, and it would be easier to treat them as two completely unrelated architectures. Also, it's worth being aware that arm32 has two different encodings: the traditional ARM encoding, and the newer Thumb2. It will be necessary to choose one or the other, and I believe the standard recommendation is to use Thumb2. |
We're building a new instruction selector infrastructure (#1344), so it would likely be best for new backends to be built once that is ready (the hope is to land it in the next month or two at most!). As part of the work, we're building an ARM64 backend as well; this is quite different from ARM32, as Julian mentions, but it could serve as an example for someone building out an ARM32 backend. |
Ok, I will wait then. |
Hi all; what's the status with ARM32/ARM 64? It appears that #1344 was merged. Love to use wasmtime on Pis..... and I thank you for your efforts here. |
As part of #1174 an ARM backend is being developed. It may take a while before it is complete enough to be merged into master, as #1174 is a big change to Cranelift. Deveopment happens at the https://github.com/cfallin/wasmtime/ fork if you want to try it. Discussion happens at https://bytecodealliance.zulipchat.com/#narrow/stream/225524-cranelift-new-backend |
It appears that AArch64/ARM64 support was merged in #1494. |
Indeed! \o/ Note that it's not yet entirely complete, and not passing the entire test suite. It's getting close, though! |
Just dropping in here to check on whether there's a timeframe for when armv7 compilation might be supported? This basically includes 95% of the Raspberry Pis on the market today. aarch64 (as far as I've been able to determine) is only applicable to the Pi4s, and only then if you've managed to install the 64-bit Raspbian. |
@autodidaddict The Raspberry Pi 3B, 3B+ and 4B can execute AArch64 (ARMv8) code. |
When I attempt to run an aarch64 binary on the pi3b+ it tells me it's the wrong file type. Does one need something other than stock Raspian?
|
Stock Raspbian has a 32bit kernel, so it doesn't support 64bit binaries. |
Ok so it looks like I just need an os like Gentoo that gives me aarch64 userland on the pi3b+. Thanks for the info! |
@autodidaddict You can try the new beta 64-bit version of Raspberry Pi OS (https://www.raspberrypi.org/forums/viewtopic.php?f=117&t=27537) or use Ubuntu or Gentoo. |
FWIW, I have been running 64-bit Fedora 32 on my Pi 3B for months, maybe even a year, and it works just great. wasmtime, using the new aarch64 backend under development, works on it no problem. |
Yup, some issues here and there remain for 32-bit builds:
|
Not just that, I believe the arm32 backend is too incomplete to do much useful. |
Indeed, the high-order bit is that the compiler backend on arm32 can only generate code for 32-bit operators right now, not 64-bit ones, and in general is pretty incomplete. There is some hope that the new isel framework could make this work easier to complete, but until then, mismatching types in the runtime are the least of our worries :-) |
For completeness to keep this issue up-to-date: we indeed removed the halfway-complete ARM32 backend because, unfortunately, no one had the resources to bring it up to a Wasm-MVP level of completeness, nor maintain it as we continue to evolve the compiler. However, we would absolutely welcome a new contribution of ARM32 support, as long as (i) it starts at a relatively complete state, i.e., is usable to run wasmtime as-is; and (ii) has an active and interested community of contributors willing to help maintain it and resolve issues. |
I would like to add ARM support by implementing ARM (not Thumb) encodings/recipes and abi. I am especially interested in armv7 little endian support.
Emit code that could run on ARM architecture.
algorithms to use?
At first i want to add basic integer operations followed by floating point instructions. I thought about implementing the latter using VFP rather than the NEON extension (As far as I know NEON does not support double precision). As for calling convention, I would like to implement AAPCS.
I already have some code that i hope to push after necessary modifications.
or worse than your proposal?
No, but I am open to suggestions.
The text was updated successfully, but these errors were encountered: