Path: blob/main/cranelift/assembler-x64/meta/src/instructions/nop.rs
1693 views
use crate::dsl::{Customization::*, Feature::*, Inst, Location::*};1use crate::dsl::{fmt, inst, r, rex};23#[rustfmt::skip] // Keeps instructions on a single line.4pub fn list() -> Vec<Inst> {5vec![6// Provide the manual-defined versions of `NOP`, though we skip the7// `rm16` format since it has the same encoding as `rm32`.8inst("nop", fmt("ZO", []), rex(0x90), _64b | compat),9inst("nopl", fmt("M", [r(rm32)]), rex([0x0F, 0x1F]).digit(0), _64b | compat),10// Though the manual specifies limited encodings of `NOP` (above), it11// recommends specific multi-byte sequenced got emitting `NOP`s between12// 2 and 9 bytes long. The following "helper" instructions emit those13// recommended sequences using custom functions.14inst("nop", fmt("1B", []), rex(0x90), _64b | compat).custom(Encode | Display),15inst("nop", fmt("2B", []), rex([0x66, 0x90]), _64b | compat).custom(Encode | Display),16inst("nop", fmt("3B", []), rex([0x0F, 0x1F]), _64b | compat).custom(Encode | Display),17inst("nop", fmt("4B", []), rex([0x0F, 0x1F]), _64b | compat).custom(Encode | Display),18inst("nop", fmt("5B", []), rex([0x0F, 0x1F]), _64b | compat).custom(Encode | Display),19inst("nop", fmt("6B", []), rex([0x66, 0x0F, 0x1F]), _64b | compat).custom(Encode | Display),20inst("nop", fmt("7B", []), rex([0x0F, 0x1F]), _64b | compat).custom(Encode | Display),21inst("nop", fmt("8B", []), rex([0x0F, 0x1F]), _64b | compat).custom(Encode | Display),22inst("nop", fmt("9B", []), rex([0x66, 0x0F, 0x1F]), _64b | compat).custom(Encode | Display),23]24}252627