osom_encoders_x86_64/encoders/lea.rs
1//! This module contains the encoders for the `lea` instruction group.
2#![allow(unused_imports)]
3
4// ** This file is automatically generated from x86.yaml schema. Do not modify! **
5
6use crate::models::{
7 EncodedX86_64Instruction, GPR, GPROrMemory, Immediate8, Immediate16, Immediate32, Immediate64, Memory, Offset,
8 Scale, Size,
9};
10
11/// Load effective address from memory into 16-bit register.
12///
13/// # Safety
14///
15/// It is the caller's responsibility to ensure that the operands are valid.
16/// Otherwise the behavior is undefined.
17#[inline]
18pub const unsafe fn encode_reg16_mem64(reg16: GPR, mem64: Memory) -> EncodedX86_64Instruction {
19 unsafe { crate::partial_encoders::mr::encode_mem([0x8D], mem64, reg16) }
20}
21
22/// Load effective address from memory into 32-bit register.
23///
24/// # Safety
25///
26/// It is the caller's responsibility to ensure that the operands are valid.
27/// Otherwise the behavior is undefined.
28#[inline]
29pub const unsafe fn encode_reg32_mem64(reg32: GPR, mem64: Memory) -> EncodedX86_64Instruction {
30 unsafe { crate::partial_encoders::mr::encode_mem([0x8D], mem64, reg32) }
31}
32
33/// Load effective address from memory into 64-bit register.
34///
35/// # Safety
36///
37/// It is the caller's responsibility to ensure that the operands are valid.
38/// Otherwise the behavior is undefined.
39#[inline]
40pub const unsafe fn encode_reg64_mem64(reg64: GPR, mem64: Memory) -> EncodedX86_64Instruction {
41 unsafe { crate::partial_encoders::mr::encode_mem([0x8D], mem64, reg64) }
42}