asmkit/x86/features/TSXLDTRK.rs
1use crate::x86::assembler::*;
2use crate::x86::operands::*;
3use super::super::opcodes::*;
4use crate::core::emitter::*;
5use crate::core::operand::*;
6
7/// A dummy operand that represents no register. Here just for simplicity.
8const NOREG: Operand = Operand::new();
9
10/// `XRESLDTRK` (XRESLDTRK).
11/// The instruction marks the end of an Intel TSX (RTM) suspend load address tracking region. If the instruction is used inside a suspend load address tracking region it will end the suspend region and all following load addresses will be added to the transaction read set. If this instruction is used inside an active transaction but not in a suspend region it will cause transaction abort.
12///
13///
14/// For more details, see the [Intel manual](https://www.felixcloutier.com/x86/XRESLDTRK.html).
15///
16/// Supported operand variants:
17///
18/// ```text
19/// +---+----------+
20/// | # | Operands |
21/// +---+----------+
22/// | 1 | (none) |
23/// +---+----------+
24/// ```
25pub trait XresldtrkEmitter {
26 fn xresldtrk(&mut self);
27}
28
29impl<'a> XresldtrkEmitter for Assembler<'a> {
30 fn xresldtrk(&mut self) {
31 self.emit(XRESLDTRK, &NOREG, &NOREG, &NOREG, &NOREG);
32 }
33}
34
35/// `XSUSLDTRK` (XSUSLDTRK).
36/// The instruction marks the start of an Intel TSX (RTM) suspend load address tracking region. If the instruction is used inside a transactional region, subsequent loads are not added to the read set of the transaction. If the instruction is used inside a suspend load address tracking region it will cause transaction abort.
37///
38///
39/// For more details, see the [Intel manual](https://www.felixcloutier.com/x86/XSUSLDTRK.html).
40///
41/// Supported operand variants:
42///
43/// ```text
44/// +---+----------+
45/// | # | Operands |
46/// +---+----------+
47/// | 1 | (none) |
48/// +---+----------+
49/// ```
50pub trait XsusldtrkEmitter {
51 fn xsusldtrk(&mut self);
52}
53
54impl<'a> XsusldtrkEmitter for Assembler<'a> {
55 fn xsusldtrk(&mut self) {
56 self.emit(XSUSLDTRK, &NOREG, &NOREG, &NOREG, &NOREG);
57 }
58}
59
60
61impl<'a> Assembler<'a> {
62 /// `XRESLDTRK` (XRESLDTRK).
63 /// The instruction marks the end of an Intel TSX (RTM) suspend load address tracking region. If the instruction is used inside a suspend load address tracking region it will end the suspend region and all following load addresses will be added to the transaction read set. If this instruction is used inside an active transaction but not in a suspend region it will cause transaction abort.
64 ///
65 ///
66 /// For more details, see the [Intel manual](https://www.felixcloutier.com/x86/XRESLDTRK.html).
67 ///
68 /// Supported operand variants:
69 ///
70 /// ```text
71 /// +---+----------+
72 /// | # | Operands |
73 /// +---+----------+
74 /// | 1 | (none) |
75 /// +---+----------+
76 /// ```
77 #[inline]
78 pub fn xresldtrk(&mut self)
79 where Assembler<'a>: XresldtrkEmitter {
80 <Self as XresldtrkEmitter>::xresldtrk(self);
81 }
82 /// `XSUSLDTRK` (XSUSLDTRK).
83 /// The instruction marks the start of an Intel TSX (RTM) suspend load address tracking region. If the instruction is used inside a transactional region, subsequent loads are not added to the read set of the transaction. If the instruction is used inside a suspend load address tracking region it will cause transaction abort.
84 ///
85 ///
86 /// For more details, see the [Intel manual](https://www.felixcloutier.com/x86/XSUSLDTRK.html).
87 ///
88 /// Supported operand variants:
89 ///
90 /// ```text
91 /// +---+----------+
92 /// | # | Operands |
93 /// +---+----------+
94 /// | 1 | (none) |
95 /// +---+----------+
96 /// ```
97 #[inline]
98 pub fn xsusldtrk(&mut self)
99 where Assembler<'a>: XsusldtrkEmitter {
100 <Self as XsusldtrkEmitter>::xsusldtrk(self);
101 }
102}