-
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
cranelift: arm32 codegen #2103
cranelift: arm32 codegen #2103
Conversation
} | ||
// Arm32 `TargetIsa` is now `TargetIsaAdapter`, which does not hold any info | ||
// about registers, so we directly access `INFO` from registers-arm32.rs. | ||
include!(concat!(env!("OUT_DIR"), "/registers-arm32.rs")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use x86 or riscv instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe some of the tests here or in regalloc/pressure.rs use the fact that S, D and Q registers overlap. I am not sure if we can achieve something similar with x86 or risc-v registers.
Subscribe to Label Actioncc @bnjbvr
This issue or pull request has been labeled: "cranelift"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Wow -- this is an excellent surprise to start my day with. First of all, thanks, @jmkrauz, for putting in all of this work! I'll review this in the next few days; I expect it will take a bit of time. One high-level comment regarding the register-overlap issue: we've thought about (and need to solve) it for other architectures too, e.g. x86-32, so I expect we'll have a better answer eventually. For now, a stopgap solution (for correctness) might be to simply allocate pairs as the fundamental unit (i.e. |
@jmkrauz, I just wanted to comment here to say first of all, we haven't forgotten this -- we're working on some framework improvements that should make this backend a little bit nicer. Specifically:
I also don't want to hold this in limbo forever; at some point (@julian-seward1 and @bnjbvr may have opinions as well) we can consider merging and gating behind an experimental feature flag until we get this up to Wasm-MVP (i32/i64/f32/f64 support) level. Thanks again and hopefully this will come together sooner rather than later :-) |
That's good news :) |
Agreed that we could review and merge this behind a flag, or just letting know that support for arm32 is experimental; we've done this for other backends, and we can work incrementally on supporting more opcodes etc. |
Hi @jmkrauz, it looks like you've refactored to use the common One thing I think we should do, however, is to put the new backend behind a feature flag until it implements Wasm MVP; otherwise someone might try to build wasmtime on arm32 and hit confusing panics. Perhaps just |
This commit adds arm32 code generation for some IR insts. Floating-point instructions are not supported, because regalloc does not allow to represent overlapping register classes, which are needed by VFP/Neon. There is also no support for big-endianness, I64 and I128 types.
Merging now is absolutely fine with me. |
Excellent, thanks! Looking forward to seeing this become a full backend! |
This commit adds arm32 Thumb2 code generation for some IR insts.
I have used machinst backend and followed Aarch64 implementation as an example.
Floating-point instructions are not supported, because regalloc
does not seem to allow to represent overlapping register classes,
which are needed by VFP/Neon.
Another lacking feature is support for I64 and I128 types.
An abi implementation is not complete, however it makes it possible
to run simple clif tests.
It may be a first step towards #1173.
This PR contains instruction emission test and clif tests for IR insts.
I don't know well who could review this.