Rust Crate Documentation

cranelift
This is the core code generator crate. It takes Cranelift IR as input and emits encoded machine instructions, along with symbolic relocations, as output.
cranelift-wasm
This crate translates WebAssembly code into Cranelift IR.
cranelift-frontend
This crate provides utilities for translating code into Cranelift IR.
cranelift-native
This crate performs auto-detection of the host, allowing Cranelift to generate code optimized for the machine it’s running on.
cranelift-reader
This crate translates from Cranelift IR’s text format into Cranelift IR in in-memory data structures.
cranelift-module
This crate manages compiling multiple functions and data objects together.
cranelift-faerie
This crate provides a faerie-based backend for cranelift-module, which emits native object files using the faerie library.
cranelift-simplejit
This crate provides a simple JIT backend for cranelift-module, which emits code and data into memory.

Indices and tables

Todo list

Todo

Add and subtract with signed overflow.

For example, see llvm.sadd.with.overflow.* and llvm.ssub.with.overflow.* in LLVM.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/cranelift/checkouts/latest/docs/ir.rst, line 828.)

Todo

Larger multiplication results.

For example, smulx which multiplies i32 operands to produce a i64 result. Alternatively, smulhi and smullo pairs.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/cranelift/checkouts/latest/docs/ir.rst, line 837.)

Todo

Integer minimum / maximum.

NEON has smin, smax, umin, and umax instructions. We should replicate those for both scalar and vector integer types. Even if the target ISA doesn’t have scalar operations, these are good pattern matching targets.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/cranelift/checkouts/latest/docs/ir.rst, line 851.)

Todo

Saturating arithmetic.

Mostly for SIMD use, but again these are good patterns for contraction. Something like usatadd, usatsub, ssatadd, and ssatsub is a good start.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/cranelift/checkouts/latest/docs/ir.rst, line 858.)