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