1# `cranelift-assembler-x64` 2 3A Cranelift-specific x64 assembler. Unlike the existing `cranelift-codegen` 4assembler, this assembler uses instructions, not instruction classes, as the 5core abstraction. 6 7### Use 8 9Like `cranelift-codegen`, using this assembler starts with `enum Inst`. For 10convenience, a `main.rs` script prints the path to this generated code: 11 12```console 13$ cat $(cargo run) | head 14... 15pub enum Inst<R:Registers> { 16 andb_i(andb_i), 17 andw_i(andw_i), 18 andl_i(andl_i), 19 ... 20``` 21 22### Test 23 24In order to check that this assembler emits correct machine code, we fuzz it 25against a known-good disassembler. We can run a quick, one-second check: 26 27```console 28$ cargo test -- --nocapture 29``` 30 31Or we can run the fuzzer indefinitely: 32 33```console 34$ cargo +nightly fuzz run -s none roundtrip -j16 35``` 36 37