1
- //! Enums of all operations for specific operand formats.
2
-
3
- #[ derive( Debug , Clone , Copy , PartialEq ) ]
4
- pub enum DualSource {
5
- Compare
6
- }
7
-
8
1
#[ derive( Debug , Clone , Copy , PartialEq ) ]
9
2
pub enum Destination {
10
3
Unstack
11
4
}
12
5
6
+ impl Destination {
7
+ pub const MAPPINGS : [ Destination ; 1 ] = [ Self :: Unstack ] ;
8
+ }
9
+
13
10
#[ derive( Debug , Clone , Copy , PartialEq ) ]
14
11
pub enum DestinationSource {
15
12
CopyRegisterToRegister
16
13
}
17
14
15
+ impl DestinationSource {
16
+ pub const MAPPINGS : [ DestinationSource ; 1 ] = [ Self :: CopyRegisterToRegister ] ;
17
+ }
18
+
18
19
#[ derive( Debug , Clone , Copy , PartialEq ) ]
19
20
pub enum DestinationDualSource {
20
21
Add ,
@@ -38,12 +39,27 @@ pub enum DestinationDualSource {
38
39
DivideFloatVector ,
39
40
}
40
41
42
+ impl DestinationDualSource {
43
+ pub const MAPPINGS : [ DestinationDualSource ; 16 ] = [
44
+ Self :: Add , Self :: Subtract , Self :: Multiply , Self :: Divide ,
45
+ Self :: AddFloat , Self :: SubtractFloat , Self :: MultiplyFloat , Self :: DivideFloat ,
46
+ Self :: AddVector , Self :: SubtractVector , Self :: MultiplyVector , Self :: DivideVector ,
47
+ Self :: AddFloatVector , Self :: SubtractFloatVector , Self :: MultiplyFloatVector , Self :: DivideFloatVector ,
48
+ ] ;
49
+ }
50
+
41
51
#[ derive( Debug , Clone , Copy , PartialEq ) ]
42
52
pub enum DestinationTripleSource {
43
53
MultiplyAndAdd ,
44
54
AddAndMultiply
45
55
}
46
56
57
+ impl DestinationTripleSource {
58
+ pub const MAPPINGS : [ DestinationTripleSource ; 2 ] = [
59
+ Self :: MultiplyAndAdd , Self :: AddAndMultiply ,
60
+ ] ;
61
+ }
62
+
47
63
#[ derive( Debug , Clone , Copy , PartialEq ) ]
48
64
pub enum DualDestinationDualSource {
49
65
DivideWithRemainder ,
@@ -52,13 +68,26 @@ pub enum DualDestinationDualSource {
52
68
DivideFloatVectorWithRemainder
53
69
}
54
70
71
+ impl DualDestinationDualSource {
72
+ pub const MAPPINGS : [ DualDestinationDualSource ; 4 ] = [
73
+ Self :: DivideWithRemainder , Self :: DivideFloatingWithRemainder ,
74
+ Self :: DivideVectorWithRemainder , Self :: DivideFloatVectorWithRemainder ,
75
+ ] ;
76
+ }
77
+
55
78
#[ derive( Debug , Clone , Copy , PartialEq ) ]
56
79
pub enum Memory {
57
80
Call ,
58
81
ReleaseMemory ,
59
82
Branch
60
83
}
61
84
85
+ impl Memory {
86
+ pub const MAPPINGS : [ Memory ; 3 ] = [
87
+ Self :: Call , Self :: ReleaseMemory , Self :: Branch ,
88
+ ] ;
89
+ }
90
+
62
91
#[ derive( Debug , Clone , Copy , PartialEq ) ]
63
92
pub enum SourceMemory {
64
93
CopyMemoryByteToRegister ,
@@ -72,10 +101,26 @@ pub enum SourceMemory {
72
101
AcquireMemoryQword
73
102
}
74
103
104
+ impl SourceMemory {
105
+ pub const MAPPINGS : [ SourceMemory ; 8 ] = [
106
+ Self :: CopyMemoryByteToRegister , Self :: CopyMemoryWordToRegister ,
107
+ Self :: CopyMemoryDwordToRegister , Self :: CopyMemoryQwordToRegister ,
108
+ Self :: AcquireMemoryByte , Self :: AcquireMemoryWord ,
109
+ Self :: AcquireMemoryDword , Self :: AcquireMemoryQword ,
110
+ ] ;
111
+ }
112
+
75
113
#[ derive( Debug , Clone , Copy , PartialEq ) ]
76
114
pub enum DestinationMemory {
77
115
CopyRegisterByteToMemory ,
78
116
CopyRegisterWordToMemory ,
79
117
CopyRegisterDwordToMemory ,
80
118
CopyRegisterQwordToMemory
81
- }
119
+ }
120
+
121
+ impl DestinationMemory {
122
+ pub const MAPPINGS : [ DestinationMemory ; 4 ] = [
123
+ Self :: CopyRegisterByteToMemory , Self :: CopyRegisterWordToMemory ,
124
+ Self :: CopyRegisterDwordToMemory , Self :: CopyRegisterQwordToMemory ,
125
+ ] ;
126
+ }
0 commit comments