Skip to content
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

Implement ARM64 [was: arm64: test "double_finalize" failed with panic 'not yet implemented'] #1075

Closed
vielmetti opened this issue Mar 29, 2019 · 6 comments
Labels
cranelift Issues related to the Cranelift code generator

Comments

@vielmetti
Copy link

System is an Ampere eMag, Packet c2.large.arm.

Build succeeds after applying the patch in bytecodealliance/cranelift#716 but a few tests fail.

test double_finalize ... FAILED
thread 'double_finalize' panicked at 'not yet implemented', cranelift-codegen/sr
c/isa/arm64/abi.rs:15:5
@vielmetti
Copy link
Author

@bnjbvr
Copy link
Member

bnjbvr commented Mar 29, 2019

Thanks for opening an issue. Unfortunately this happens because we don't have an aarch64 implementation yet, only stubs to have it compile. So Cranelift can't target the aarch64 architecture as of today. Would you be interested in helping adding support for it? (We're in the middle of rewriting the DSL that makes it easy to add new ISA targets, hopefully done in a few weeks/months, but work on this using the Python DSL could be done in the meanwhile)

@vielmetti
Copy link
Author

Thanks @bnjbvr - glad that you've done the work to make it compile with stubs, that will make this work easier. I am talking to a bunch of aarch64 folks next week, and will bring up the question. Do you have any sense of degree of difficulty to do this work? (e.g. how much familiarity with the instruction set is required)

@bnjbvr
Copy link
Member

bnjbvr commented Mar 29, 2019

One should know how to encode ARM64 instructions (or read the ARM ARM), and some other low-level details which are a bit hard to enumerate. For instance, something that comes to mind is that ARM/aarch64 have restrictions in ranges of jump targets, but this should already be gracefully handled by Cranelift. Another example is that there are many ways to emit immediates bigger than an instruction's size with aarch64, and some of them are more optimized than others. My guts would tell me that implementing something that works would be a great first step, and that implementing something very optimized could wait a bit.

See this (quite stall, very wip-y) commit from a stall branch that implemented a simple aarch64 move, this can give hints about where to read / start etc..

@bnjbvr bnjbvr changed the title arm64: test "double_finalize" failed with panic 'not yet implemented' Implement ARM64 [was: arm64: test "double_finalize" failed with panic 'not yet implemented' Apr 11, 2019
@bnjbvr bnjbvr changed the title Implement ARM64 [was: arm64: test "double_finalize" failed with panic 'not yet implemented' Implement ARM64 [was: arm64: test "double_finalize" failed with panic 'not yet implemented'] Apr 11, 2019
@cfallin
Copy link
Member

cfallin commented Jan 14, 2020

As a note to link this with current efforts, we are developing an ARM4 backend as part of the new instruction selector rework (#1344). This will hopefully fall into place within the next few months.

@alexcrichton alexcrichton transferred this issue from bytecodealliance/cranelift Feb 28, 2020
@alexcrichton alexcrichton added the cranelift Issues related to the Cranelift code generator label Feb 28, 2020
@cfallin
Copy link
Member

cfallin commented Apr 16, 2020

Fixed with #1494.

@cfallin cfallin closed this as completed Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

4 participants