Skip to main content

asmkit/x86/
mod.rs

1//! X86 Assembler.
2//!
3//! This module provides functionality for encoding x86 instructions.
4//!
5//! Main entrypoint is the [`Assembler`] struct. Instructions are emitted either by id
6//! through [`Assembler::emit_n`] or through the generated per-mnemonic emitter traits
7//! (e.g. `MovEmitter::mov`), both backed by the asmjit-style InstInfo
8//! pipeline in the internal emitter implementation.
9//!
10#[doc(hidden)]
11pub(crate) mod arch_traits;
12#[cfg(feature = "x86")]
13pub mod assembler;
14#[cfg(feature = "x86")]
15pub(crate) mod emit;
16#[cfg(feature = "x86")]
17#[doc(hidden)]
18mod emitter;
19pub(crate) mod encoder;
20pub(crate) mod encoder_tables;
21pub(crate) mod instapi;
22#[allow(
23    dead_code,
24    rustdoc::broken_intra_doc_links,
25    rustdoc::invalid_html_tags,
26    rustdoc::private_intra_doc_links
27)]
28pub(crate) mod instdb;
29pub(crate) mod opcode;
30pub mod operands;
31
32pub use crate::X86Error;
33pub use crate::core::operand::imm;
34#[cfg(feature = "x86")]
35pub use assembler::*;
36#[cfg(feature = "x86")]
37pub use emitter::*;
38pub use instapi::query_rw_info;
39pub use instdb::{CpuFeature, InstId};
40pub use operands::*;
41
42/// Unstable validation tooling; this is not a stable instruction-encoding API.
43#[cfg(feature = "validation")]
44#[doc(hidden)]
45pub mod coverage {
46    pub use super::instdb::{
47        Avx512Flags, INST_COMMON_INFO_TABLE, INST_INFO_TABLE, INST_NAME_INDEX_TABLE,
48        INST_NAME_STRING_TABLE, INST_SIGNATURE_TABLE, InstSignature, Mode, OP_SIGNATURE_TABLE,
49        OpFlags, OpSignature,
50    };
51}