Eventually, we should be able to unify this function's implementation with the aarch64 one; but the latter does much more, and this would require abstractions brought up in another pending PR#2142.
This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.