osom_encoders_x86_64/encoders/jmp.rs
1//! This module contains the encoders for the `jmp` 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/// Short jump to RIP-relative address. Takes 2 bytes only.
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_imm8(imm8: Immediate8) -> EncodedX86_64Instruction {
19 unsafe { crate::partial_encoders::i::encode_imm8([0xEB], imm8) }
20}
21
22/// Long jump to RIP-relative address. Takes 5 bytes.
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_imm32(imm32: Immediate32) -> EncodedX86_64Instruction {
30 unsafe { crate::partial_encoders::i::encode_imm32([0xE9], imm32) }
31}
32
33/// Jump to 64-bit register or memory.
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_rm64(rm64: GPROrMemory) -> EncodedX86_64Instruction {
41 unsafe { crate::partial_encoders::m::encode_gpr_or_memory([0xFF], 0x04, rm64, false, false) }
42}