MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / encode_modrm

Function encode_modrm

cranelift/assembler-x64/src/rex.rs:11–16  ·  view source on GitHub ↗
(m0d: u8, enc_reg_g: u8, rm_e: u8)

Source from the content-addressed store, hash-verified

9/// Encode the ModR/M byte.
10#[inline]
11pub(crate) fn encode_modrm(m0d: u8, enc_reg_g: u8, rm_e: u8) -> u8 {
12 debug_assert!(m0d < 4);
13 debug_assert!(enc_reg_g < 8);
14 debug_assert!(rm_e < 8);
15 ((m0d & 3) << 6) | ((enc_reg_g & 7) << 3) | (rm_e & 7)
16}
17
18/// Encode the SIB byte (scale-index-base).
19#[inline]

Callers 3

encode_modrmMethod · 0.85
encode_rex_suffixesMethod · 0.85
emit_modrm_sib_dispFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected