Debian Codegraph @

operand/checks.go

raw symbols SCIP
1 package operandscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/
2
3 import "github.com/mmcloughlin/avo/regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/"
4
5 // Pure type assertion checks:
6
7 // IsRegister returns whether op has type reg.Register.
8 func IsRegisterscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegister().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool { _, ok := op.(regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.Registerscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#); return ok }
9
10 // IsMem returns whether op has type Mem.
11 func IsMemscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMem().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool { _, ok := op.(Memscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#); return ok }
12
13 // IsRel returns whether op has type Rel.
14 func IsRelscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRel().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool { _, ok := op.(Relscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Rel#); return ok }
15
16 // Checks corresponding to specific operand types in the Intel Manual:
17
18 // Is1 returns true if op is the immediate constant 1.
19 func Is1scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Is1().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
20 i, ok := op.(U8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U8#)
21 return ok && i == 1
22 }
23
24 // Is3 returns true if op is the immediate constant 3.
25 func Is3scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Is3().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
26 i, ok := op.(U8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U8#)
27 return ok && i == 3
28 }
29
30 // IsIMM2U returns true if op is a 2-bit unsigned immediate (less than 4).
31 func IsIMM2Uscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsIMM2U().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
32 i, ok := op.(U8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U8#)
33 return ok && i < 4
34 }
35
36 // IsIMM8 returns true is op is an 8-bit immediate.
37 func IsIMM8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsIMM8().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
38 _, uok := op.(U8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U8#)
39 _, iok := op.(I8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/I8#)
40 return uok || iok
41 }
42
43 // IsIMM16 returns true is op is a 16-bit immediate.
44 func IsIMM16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsIMM16().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
45 _, uok := op.(U16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U16#)
46 _, iok := op.(I16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/I16#)
47 return uok || iok
48 }
49
50 // IsIMM32 returns true is op is a 32-bit immediate.
51 func IsIMM32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsIMM32().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
52 _, uok := op.(U32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U32#)
53 _, iok := op.(I32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/I32#)
54 return uok || iok
55 }
56
57 // IsIMM64 returns true is op is a 64-bit immediate.
58 func IsIMM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsIMM64().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
59 _, uok := op.(U64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/U64#)
60 _, iok := op.(I64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/I64#)
61 return uok || iok
62 }
63
64 // IsAL returns true if op is the AL register.
65 func IsALscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsAL().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
66 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.ALscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/AL.
67 }
68
69 // IsCL returns true if op is the CL register.
70 func IsCLscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsCL().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
71 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.CLscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/CL.
72 }
73
74 // IsAX returns true if op is the 16-bit AX register.
75 func IsAXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsAX().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
76 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.AXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/AX.
77 }
78
79 // IsEAX returns true if op is the 32-bit EAX register.
80 func IsEAXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsEAX().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
81 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.EAXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/EAX.
82 }
83
84 // IsRAX returns true if op is the 64-bit RAX register.
85 func IsRAXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRAX().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
86 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.RAXscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/RAX.
87 }
88
89 // IsR8 returns true if op is an 8-bit general-purpose register.
90 func IsR8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsR8().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
91 return IsGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsGP().(op, 1)
92 }
93
94 // IsR16 returns true if op is a 16-bit general-purpose register.
95 func IsR16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsR16().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
96 return IsGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsGP().(op, 2)
97 }
98
99 // IsR32 returns true if op is a 32-bit general-purpose register.
100 func IsR32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsR32().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
101 return IsGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsGP().(op, 4)
102 }
103
104 // IsR64 returns true if op is a 64-bit general-purpose register.
105 func IsR64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsR64().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
106 return IsGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsGP().(op, 8)
107 }
108
109 // IsPseudo returns true if op is a pseudo register.
110 func IsPseudoscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsPseudo().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
111 return IsRegisterKindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKind().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindPseudoscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindPseudo.)
112 }
113
114 // IsGP returns true if op is a general-purpose register of size n bytes.
115 func IsGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsGP().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#, n uint) bool {
116 return IsRegisterKindSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKindSize().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindGP., n)
117 }
118
119 // IsXMM0 returns true if op is the X0 register.
120 func IsXMM0scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsXMM0().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
121 return op == regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.X0scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/X0.
122 }
123
124 // IsXMM returns true if op is a 128-bit XMM register.
125 func IsXMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsXMM().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
126 return IsRegisterKindSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKindSize().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindVectorscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindVector., 16)
127 }
128
129 // IsYMM returns true if op is a 256-bit YMM register.
130 func IsYMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsYMM().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
131 return IsRegisterKindSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKindSize().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindVectorscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindVector., 32)
132 }
133
134 // IsZMM returns true if op is a 512-bit ZMM register.
135 func IsZMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsZMM().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
136 return IsRegisterKindSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKindSize().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindVectorscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindVector., 64)
137 }
138
139 // IsK returns true if op is an Opmask register.
140 func IsKscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsK().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
141 return IsRegisterKindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKind().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindOpmaskscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindOpmask.)
142 }
143
144 // IsRegisterKindSize returns true if op is a register of the given kind and size in bytes.
145 func IsRegisterKindSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKindSize().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#, k regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.Kindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Kind#, n uint) bool {
146 r, ok := op.(regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.Registerscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#)
147 return ok && r.Kindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#Kind.() == k && r.Sizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#Size.() == n
148 }
149
150 // IsRegisterKind returns true if op is a register of the given kind.
151 func IsRegisterKindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKind().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#, k regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.Kindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Kind#) bool {
152 r, ok := op.(regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.Registerscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#)
153 return ok && r.Kindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/Register#Kind.() == k
154 }
155
156 // IsM returns true if op is a 16-, 32- or 64-bit memory operand.
157 func IsMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
158 // TODO(mbm): confirm "m" check is defined correctly
159 // Intel manual: "A 16-, 32- or 64-bit operand in memory."
160 return IsM16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM16().(op) || IsM32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM32().(op) || IsM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM64().(op)
161 }
162
163 // IsM8 returns true if op is an 8-bit memory operand.
164 func IsM8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM8().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
165 // TODO(mbm): confirm "m8" check is defined correctly
166 // Intel manual: "A byte operand in memory, usually expressed as a variable or
167 // array name, but pointed to by the DS:(E)SI or ES:(E)DI registers. In 64-bit
168 // mode, it is pointed to by the RSI or RDI registers."
169 return IsMSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMSize().(op, 1)
170 }
171
172 // IsM16 returns true if op is a 16-bit memory operand.
173 func IsM16scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM16().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
174 return IsMSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMSize().(op, 2)
175 }
176
177 // IsM32 returns true if op is a 16-bit memory operand.
178 func IsM32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM32().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
179 return IsMSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMSize().(op, 4)
180 }
181
182 // IsM64 returns true if op is a 64-bit memory operand.
183 func IsM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM64().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
184 return IsMSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMSize().(op, 8)
185 }
186
187 // IsMSize returns true if op is a memory operand using general-purpose address
188 // registers of the given size in bytes.
189 func IsMSizescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMSize().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#, n uint) bool {
190 // TODO(mbm): should memory operands have a size attribute as well?
191 // TODO(mbm): m8,m16,m32,m64 checks do not actually check size
192 m, ok := op.(Memscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#)
193 return ok && IsMRegscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMReg().(m.Basescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#Base.) && (m.Indexscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#Index. == nil || IsMRegscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMReg().(m.Indexscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#Index.))
194 }
195
196 // IsMReg returns true if op is a register that can be used in a memory operand.
197 func IsMRegscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsMReg().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
198 return IsPseudoscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsPseudo().(op) || IsRegisterKindscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsRegisterKind().(op, regscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/.KindGPscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/reg`/KindGP.)
199 }
200
201 // IsM128 returns true if op is a 128-bit memory operand.
202 func IsM128scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM128().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
203 // TODO(mbm): should "m128" be the same as "m64"?
204 return IsM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM64().(op)
205 }
206
207 // IsM256 returns true if op is a 256-bit memory operand.
208 func IsM256scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM256().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
209 // TODO(mbm): should "m256" be the same as "m64"?
210 return IsM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM64().(op)
211 }
212
213 // IsM512 returns true if op is a 512-bit memory operand.
214 func IsM512scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM512().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
215 // TODO(mbm): should "m512" be the same as "m64"?
216 return IsM64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsM64().(op)
217 }
218
219 // IsVM32X returns true if op is a vector memory operand with 32-bit XMM index.
220 func IsVM32Xscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM32X().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
221 return IsVmxscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmx().(op)
222 }
223
224 // IsVM64X returns true if op is a vector memory operand with 64-bit XMM index.
225 func IsVM64Xscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM64X().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
226 return IsVmxscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmx().(op)
227 }
228
229 // IsVmx returns true if op is a vector memory operand with XMM index.
230 func IsVmxscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmx().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
231 return isvmscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/isvm().(op, IsXMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsXMM().)
232 }
233
234 // IsVM32Y returns true if op is a vector memory operand with 32-bit YMM index.
235 func IsVM32Yscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM32Y().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
236 return IsVmyscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmy().(op)
237 }
238
239 // IsVM64Y returns true if op is a vector memory operand with 64-bit YMM index.
240 func IsVM64Yscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM64Y().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
241 return IsVmyscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmy().(op)
242 }
243
244 // IsVmy returns true if op is a vector memory operand with YMM index.
245 func IsVmyscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmy().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
246 return isvmscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/isvm().(op, IsYMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsYMM().)
247 }
248
249 // IsVM32Z returns true if op is a vector memory operand with 32-bit ZMM index.
250 func IsVM32Zscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM32Z().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
251 return IsVmzscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmz().(op)
252 }
253
254 // IsVM64Z returns true if op is a vector memory operand with 64-bit ZMM index.
255 func IsVM64Zscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVM64Z().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
256 return IsVmzscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmz().(op)
257 }
258
259 // IsVmz returns true if op is a vector memory operand with ZMM index.
260 func IsVmzscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsVmz().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
261 return isvmscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/isvm().(op, IsZMMscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsZMM().)
262 }
263
264 func isvmscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/isvm().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#, idx func(Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool) bool {
265 m, ok := op.(Memscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#)
266 return ok && IsR64scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsR64().(m.Basescip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#Base.) && idx(m.Indexscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Mem#Index.)
267 }
268
269 // IsREL8 returns true if op is an 8-bit offset relative to instruction pointer.
270 func IsREL8scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsREL8().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
271 r, ok := op.(Relscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Rel#)
272 return ok && r == Relscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Rel#(int8(r))
273 }
274
275 // IsREL32 returns true if op is an offset relative to instruction pointer, or a
276 // label reference.
277 func IsREL32scip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/IsREL32().(op Opscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Op#) bool {
278 // TODO(mbm): should labels be considered separately?
279 _, rel := op.(Relscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/Rel#)
280 _, label := op.(LabelRefscip-go gomod github.com/mmcloughlin/avo . `github.com/mmcloughlin/avo/operand`/LabelRef#)
281 return rel || label
282 }