• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_MOP_VALID_H
16 #define MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_MOP_VALID_H
17 #include "aarch64_imm_valid.h"
18 #include "aarch64_isa.h"
19 #include "mempool_allocator.h"
20 #include "operand.h"
21 
22 namespace maplebe {
23 // Immediate verification for a byte from/to memory. simm: -256 ~ 255; pimm: 0 ~ 4095.
StrLdr8Valid(Operand * o)24 inline bool StrLdr8Valid(Operand *o)
25 {
26     return (static_cast<MemOperand *>(o)->GetAddrMode() == MemOperand::kAddrModeLo12Li) ||
27            StrLdrInsnSignedOfstValid(AArch64isa::GetMemOpndOffsetValue(o), k0ByteSize,
28                                      static_cast<MemOperand *>(o)->IsIntactIndexed());
29 }
30 
31 // Immediate verification for half word from/to memory. simm: -256 ~ 255; pimm: 0 ~ 8190, multiple of 2.
StrLdr16Valid(Operand * o)32 inline bool StrLdr16Valid(Operand *o)
33 {
34     MemOperand *memOpnd = static_cast<MemOperand *>(o);
35     if (memOpnd->GetAddrMode() == MemOperand::kAddrModeLo12Li) {
36         uint8 symAlign = 0;
37         const MIRSymbol *sym = memOpnd->GetSymbol();
38         if (sym) {
39             symAlign = 1U << sym->GetSymbolAlign();
40         }
41         return ((symAlign + static_cast<uint64>(AArch64isa::GetMemOpndOffsetValue(o))) &
42                 static_cast<int64>(k1BitSize)) == static_cast<int64>(k0BitSize);
43     }
44     return StrLdrInsnSignedOfstValid(AArch64isa::GetMemOpndOffsetValue(o), k1ByteSize, memOpnd->IsIntactIndexed());
45 }
46 
47 // Immediate verification for a word from/to memory. simm: -256 ~ 255; pimm: 0 ~ 16380, multiple of 4.
StrLdr32Valid(Operand * o)48 inline bool StrLdr32Valid(Operand *o)
49 {
50     MemOperand *memOpnd = static_cast<MemOperand *>(o);
51     if (memOpnd->GetAddrMode() == MemOperand::kAddrModeLo12Li) {
52         uint8 symAlign = 0;
53         const MIRSymbol *sym = memOpnd->GetSymbol();
54         if (sym) {
55             symAlign = 1U << sym->GetSymbolAlign();
56         }
57         return ((symAlign + static_cast<uint64>(AArch64isa::GetMemOpndOffsetValue(o))) &
58                 static_cast<int64>(k3BitSize)) == static_cast<int64>(k0BitSize);
59     }
60     return StrLdrInsnSignedOfstValid(AArch64isa::GetMemOpndOffsetValue(o), k2ByteSize, memOpnd->IsIntactIndexed());
61 }
62 
63 // Immediate verification: value range -256 ~ 252, multiple of 4.
StrLdr32PairValid(Operand * o)64 inline bool StrLdr32PairValid(Operand *o)
65 {
66     constexpr uint64 sImmValidOffset = 3;
67     int64 value = AArch64isa::GetMemOpndOffsetValue(o);
68     if ((value <= kMaxSimm32Pair) && (value >= kMinSimm32)) {
69         return (static_cast<uint64>(value) & sImmValidOffset) > 0 ? false : true;
70     }
71     return false;
72 }
73 
74 // Immediate verification for 2 words from/to memory. simm: -256 ~ 255; pimm: 0 ~ 32760, multiple of 8.
StrLdr64Valid(Operand * o)75 inline bool StrLdr64Valid(Operand *o)
76 {
77     MemOperand *memOpnd = static_cast<MemOperand *>(o);
78     if (memOpnd->GetAddrMode() == MemOperand::kAddrModeLo12Li) {
79         uint8 symAlign = 0;
80         const MIRSymbol *sym = memOpnd->GetSymbol();
81         if (sym) {
82             symAlign = 1U << sym->GetSymbolAlign();
83         }
84         return ((symAlign + static_cast<uint64>(AArch64isa::GetMemOpndOffsetValue(o))) &
85                 static_cast<int64>(k7BitSize)) == static_cast<int64>(k0BitSize);
86     }
87     return StrLdrInsnSignedOfstValid(AArch64isa::GetMemOpndOffsetValue(o), k3ByteSize, memOpnd->IsIntactIndexed());
88 }
89 
90 // Immediate verification: value range -512 ~ 504, multiple of 8.
StrLdr64PairValid(Operand * o)91 inline bool StrLdr64PairValid(Operand *o)
92 {
93     constexpr uint64 sImmValidOffset = 7;
94     int64 value = AArch64isa::GetMemOpndOffsetValue(o);
95     if (value <= kMaxSimm64Pair && (value >= kMinSimm64)) {
96         return (static_cast<uint64>(value) & sImmValidOffset) > 0 ? false : true;
97     }
98     return false;
99 }
100 
101 // Immediate verification for 4 words from/to memory. simm: -256 ~ 255; pimm: 0 ~ 65520, multiple of 16.
StrLdr128Valid(Operand * o)102 inline bool StrLdr128Valid(Operand *o)
103 {
104     MemOperand *memOpnd = static_cast<MemOperand *>(o);
105     if (memOpnd->GetAddrMode() == MemOperand::kAddrModeLo12Li) {
106         uint8 symAlign = 0;
107         const MIRSymbol *sym = memOpnd->GetSymbol();
108         if (sym && sym->IsConst()) {
109             symAlign = 1U << sym->GetSymbolAlign();
110         }
111         return ((symAlign + static_cast<uint64>(AArch64isa::GetMemOpndOffsetValue(o))) &
112                 static_cast<int64>(k15BitSize)) == static_cast<int64>(k0BitSize);
113     }
114     return StrLdrInsnSignedOfstValid(AArch64isa::GetMemOpndOffsetValue(o), k4ByteSize, memOpnd->IsIntactIndexed());
115 }
116 
117 // Immediate verification: value range -1024 ~ 1008, multiple of 16.
StrLdr128PairValid(Operand * o)118 inline bool StrLdr128PairValid(Operand *o)
119 {
120     int64 value = AArch64isa::GetMemOpndOffsetValue(o);
121     if (value < k1024BitSize && (value >= kNegative1024BitSize)) {
122         return (static_cast<uint64>(value) & 0xf) > 0 ? false : true;
123     }
124     return false;
125 }
126 
127 // Load-Acquire & Store-Release & Load/Store-Exclusive offset value must be #0 if not absent
IsOfstZero(Operand * o)128 inline bool IsOfstZero(Operand *o)
129 {
130     int64 value = AArch64isa::GetMemOpndOffsetValue(o);
131     if (value == static_cast<int64>(k0BitSize)) {
132         return true;
133     }
134     return false;
135 }
136 
MOP_wmovri32Valid(const MapleVector<Operand * > & opnds)137 inline bool MOP_wmovri32Valid(const MapleVector<Operand *> &opnds)
138 {
139     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
140                            ? IsSingleInstructionMovable32(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
141                            : true;
142     return checkSecond;
143 }
144 
MOP_xmovri64Valid(const MapleVector<Operand * > & opnds)145 inline bool MOP_xmovri64Valid(const MapleVector<Operand *> &opnds)
146 {
147     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
148                            ? IsSingleInstructionMovable64(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
149                            : true;
150     return checkSecond;
151 }
152 
MOP_xaddrrrsValid(const MapleVector<Operand * > & opnds)153 inline bool MOP_xaddrrrsValid(const MapleVector<Operand *> &opnds)
154 {
155     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
156                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
157                            : true;
158     return checkFourth;
159 }
160 
MOP_xaddsrrrsValid(const MapleVector<Operand * > & opnds)161 inline bool MOP_xaddsrrrsValid(const MapleVector<Operand *> &opnds)
162 {
163     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
164                           ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
165                           : true;
166     return checkFifth;
167 }
168 
MOP_xxwaddrrreValid(const MapleVector<Operand * > & opnds)169 inline bool MOP_xxwaddrrreValid(const MapleVector<Operand *> &opnds)
170 {
171     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
172                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
173                            : true;
174     return checkFourth;
175 }
176 
MOP_xaddrri24Valid(const MapleVector<Operand * > & opnds)177 inline bool MOP_xaddrri24Valid(const MapleVector<Operand *> &opnds)
178 {
179     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
180                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
181                           : true;
182     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
183                            ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
184                            : true;
185     return checkThird && checkFourth;
186 }
187 
MOP_xaddrri12Valid(const MapleVector<Operand * > & opnds)188 inline bool MOP_xaddrri12Valid(const MapleVector<Operand *> &opnds)
189 {
190     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
191                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
192                           : true;
193     return checkThird;
194 }
195 
MOP_xaddsrri12Valid(const MapleVector<Operand * > & opnds)196 inline bool MOP_xaddsrri12Valid(const MapleVector<Operand *> &opnds)
197 {
198     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
199                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
200                            : true;
201     return checkFourth;
202 }
203 
MOP_waddrrrsValid(const MapleVector<Operand * > & opnds)204 inline bool MOP_waddrrrsValid(const MapleVector<Operand *> &opnds)
205 {
206     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
207                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
208                            : true;
209     return checkFourth;
210 }
211 
MOP_waddsrrrsValid(const MapleVector<Operand * > & opnds)212 inline bool MOP_waddsrrrsValid(const MapleVector<Operand *> &opnds)
213 {
214     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
215                           ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
216                           : true;
217     return checkFifth;
218 }
219 
MOP_wwwaddrrreValid(const MapleVector<Operand * > & opnds)220 inline bool MOP_wwwaddrrreValid(const MapleVector<Operand *> &opnds)
221 {
222     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
223                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
224                            : true;
225     return checkFourth;
226 }
227 
MOP_waddrri24Valid(const MapleVector<Operand * > & opnds)228 inline bool MOP_waddrri24Valid(const MapleVector<Operand *> &opnds)
229 {
230     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
231                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
232                           : true;
233     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
234                            ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
235                            : true;
236     return checkThird && checkFourth;
237 }
238 
MOP_waddrri12Valid(const MapleVector<Operand * > & opnds)239 inline bool MOP_waddrri12Valid(const MapleVector<Operand *> &opnds)
240 {
241     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
242                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
243                           : true;
244     return checkThird;
245 }
246 
MOP_waddsrri12Valid(const MapleVector<Operand * > & opnds)247 inline bool MOP_waddsrri12Valid(const MapleVector<Operand *> &opnds)
248 {
249     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
250                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
251                            : true;
252     return checkFourth;
253 }
254 
MOP_xsubrrrsValid(const MapleVector<Operand * > & opnds)255 inline bool MOP_xsubrrrsValid(const MapleVector<Operand *> &opnds)
256 {
257     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
258                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
259                            : true;
260     return checkFourth;
261 }
262 
MOP_xsubsrrrsValid(const MapleVector<Operand * > & opnds)263 inline bool MOP_xsubsrrrsValid(const MapleVector<Operand *> &opnds)
264 {
265     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
266                           ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
267                           : true;
268     return checkFifth;
269 }
270 
MOP_xsubrri24Valid(const MapleVector<Operand * > & opnds)271 inline bool MOP_xsubrri24Valid(const MapleVector<Operand *> &opnds)
272 {
273     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
274                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
275                           : true;
276     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
277                            ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
278                            : true;
279     return checkThird && checkFourth;
280 }
281 
MOP_xsubsrri24Valid(const MapleVector<Operand * > & opnds)282 inline bool MOP_xsubsrri24Valid(const MapleVector<Operand *> &opnds)
283 {
284     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
285                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
286                            : true;
287     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
288                           ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
289                           : true;
290     return checkFourth && checkFifth;
291 }
292 
MOP_xsubrri12Valid(const MapleVector<Operand * > & opnds)293 inline bool MOP_xsubrri12Valid(const MapleVector<Operand *> &opnds)
294 {
295     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
296                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
297                           : true;
298     return checkThird;
299 }
300 
MOP_xsubsrri12Valid(const MapleVector<Operand * > & opnds)301 inline bool MOP_xsubsrri12Valid(const MapleVector<Operand *> &opnds)
302 {
303     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
304                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
305                            : true;
306     return checkFourth;
307 }
308 
MOP_wsubrrrsValid(const MapleVector<Operand * > & opnds)309 inline bool MOP_wsubrrrsValid(const MapleVector<Operand *> &opnds)
310 {
311     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
312                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
313                            : true;
314     return checkFourth;
315 }
316 
MOP_wsubsrrrsValid(const MapleVector<Operand * > & opnds)317 inline bool MOP_wsubsrrrsValid(const MapleVector<Operand *> &opnds)
318 {
319     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
320                           ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
321                           : true;
322     return checkFifth;
323 }
324 
MOP_wsubrri24Valid(const MapleVector<Operand * > & opnds)325 inline bool MOP_wsubrri24Valid(const MapleVector<Operand *> &opnds)
326 {
327     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
328                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
329                           : true;
330     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
331                            ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
332                            : true;
333     return checkThird && checkFourth;
334 }
335 
MOP_wsubsrri24Valid(const MapleVector<Operand * > & opnds)336 inline bool MOP_wsubsrri24Valid(const MapleVector<Operand *> &opnds)
337 {
338     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
339                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
340                            : true;
341     bool checkFifth = (opnds[kInsnFifthOpnd] != nullptr)
342                           ? LeftShift12Valid(static_cast<BitShiftOperand *>(opnds[kInsnFifthOpnd])->GetValue())
343                           : true;
344     return checkFourth && checkFifth;
345 }
346 
MOP_wsubrri12Valid(const MapleVector<Operand * > & opnds)347 inline bool MOP_wsubrri12Valid(const MapleVector<Operand *> &opnds)
348 {
349     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
350                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
351                           : true;
352     return checkThird;
353 }
354 
MOP_wsubsrri12Valid(const MapleVector<Operand * > & opnds)355 inline bool MOP_wsubsrri12Valid(const MapleVector<Operand *> &opnds)
356 {
357     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
358                            ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
359                            : true;
360     return checkFourth;
361 }
362 
MOP_xxwsubrrreValid(const MapleVector<Operand * > & opnds)363 inline bool MOP_xxwsubrrreValid(const MapleVector<Operand *> &opnds)
364 {
365     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
366                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
367                            : true;
368     return checkFourth;
369 }
370 
MOP_wwwsubrrreValid(const MapleVector<Operand * > & opnds)371 inline bool MOP_wwwsubrrreValid(const MapleVector<Operand *> &opnds)
372 {
373     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
374                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
375                            : true;
376     return checkFourth;
377 }
378 
MOP_xandrrrsValid(const MapleVector<Operand * > & opnds)379 inline bool MOP_xandrrrsValid(const MapleVector<Operand *> &opnds)
380 {
381     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
382                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
383                            : true;
384     return checkFourth;
385 }
386 
MOP_xandrri13Valid(const MapleVector<Operand * > & opnds)387 inline bool MOP_xandrri13Valid(const MapleVector<Operand *> &opnds)
388 {
389     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
390                           ? Imm13BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
391                           : true;
392     return checkThird;
393 }
394 
MOP_wandrrrsValid(const MapleVector<Operand * > & opnds)395 inline bool MOP_wandrrrsValid(const MapleVector<Operand *> &opnds)
396 {
397     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
398                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
399                            : true;
400     return checkFourth;
401 }
402 
MOP_wandrri12Valid(const MapleVector<Operand * > & opnds)403 inline bool MOP_wandrri12Valid(const MapleVector<Operand *> &opnds)
404 {
405     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
406                           ? Imm12BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
407                           : true;
408     return checkThird;
409 }
410 
MOP_xiorrrrsValid(const MapleVector<Operand * > & opnds)411 inline bool MOP_xiorrrrsValid(const MapleVector<Operand *> &opnds)
412 {
413     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
414                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
415                            : true;
416     return checkFourth;
417 }
418 
MOP_xiorrri13Valid(const MapleVector<Operand * > & opnds)419 inline bool MOP_xiorrri13Valid(const MapleVector<Operand *> &opnds)
420 {
421     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
422                           ? Imm13BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
423                           : true;
424     return checkThird;
425 }
426 
MOP_wiorrrrsValid(const MapleVector<Operand * > & opnds)427 inline bool MOP_wiorrrrsValid(const MapleVector<Operand *> &opnds)
428 {
429     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
430                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
431                            : true;
432     return checkFourth;
433 }
434 
MOP_wiorrri12Valid(const MapleVector<Operand * > & opnds)435 inline bool MOP_wiorrri12Valid(const MapleVector<Operand *> &opnds)
436 {
437     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
438                           ? Imm12BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
439                           : true;
440     return checkThird;
441 }
442 
MOP_xeorrrrsValid(const MapleVector<Operand * > & opnds)443 inline bool MOP_xeorrrrsValid(const MapleVector<Operand *> &opnds)
444 {
445     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
446                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
447                            : true;
448     return checkFourth;
449 }
450 
MOP_xeorrri13Valid(const MapleVector<Operand * > & opnds)451 inline bool MOP_xeorrri13Valid(const MapleVector<Operand *> &opnds)
452 {
453     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
454                           ? Imm13BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
455                           : true;
456     return checkThird;
457 }
458 
MOP_weorrrrsValid(const MapleVector<Operand * > & opnds)459 inline bool MOP_weorrrrsValid(const MapleVector<Operand *> &opnds)
460 {
461     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
462                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
463                            : true;
464     return checkFourth;
465 }
466 
MOP_weorrri12Valid(const MapleVector<Operand * > & opnds)467 inline bool MOP_weorrri12Valid(const MapleVector<Operand *> &opnds)
468 {
469     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
470                           ? Imm12BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
471                           : true;
472     return checkThird;
473 }
474 
MOP_wubfxrri5i5Valid(const MapleVector<Operand * > & opnds)475 inline bool MOP_wubfxrri5i5Valid(const MapleVector<Operand *> &opnds)
476 {
477     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
478         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
479         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
480         return Lsb5BitValid(lsb) && Width5BitValid(width, lsb);
481     } else {
482         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
483                               ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
484                               : true;
485         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
486                                ? Width5BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
487                                : true;
488         return checkThird && checkFourth;
489     }
490 }
491 
MOP_xubfxrri6i6Valid(const MapleVector<Operand * > & opnds)492 inline bool MOP_xubfxrri6i6Valid(const MapleVector<Operand *> &opnds)
493 {
494     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
495         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
496         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
497         return Lsb6BitValid(lsb) && Width6BitValid(width, lsb);
498     } else {
499         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
500                               ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
501                               : true;
502         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
503                                ? Width6BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
504                                : true;
505         return checkThird && checkFourth;
506     }
507 }
508 
MOP_wsbfxrri5i5Valid(const MapleVector<Operand * > & opnds)509 inline bool MOP_wsbfxrri5i5Valid(const MapleVector<Operand *> &opnds)
510 {
511     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
512         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
513         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
514         return Lsb5BitValid(lsb) && Width5BitValid(width, lsb);
515     } else {
516         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
517                               ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
518                               : true;
519         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
520                                ? Width5BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
521                                : true;
522         return checkThird && checkFourth;
523     }
524 }
525 
MOP_xsbfxrri6i6Valid(const MapleVector<Operand * > & opnds)526 inline bool MOP_xsbfxrri6i6Valid(const MapleVector<Operand *> &opnds)
527 {
528     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
529         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
530         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
531         return Lsb6BitValid(lsb) && Width6BitValid(width, lsb);
532     } else {
533         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
534                               ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
535                               : true;
536         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
537                                ? Width6BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
538                                : true;
539         return checkThird && checkFourth;
540     }
541 }
542 
MOP_wubfizrri5i5Valid(const MapleVector<Operand * > & opnds)543 inline bool MOP_wubfizrri5i5Valid(const MapleVector<Operand *> &opnds)
544 {
545     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
546         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
547         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
548         return Lsb5BitValid(lsb) && Width5BitValid(width, lsb);
549     } else {
550         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
551                               ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
552                               : true;
553         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
554                                ? Width5BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
555                                : true;
556         return checkThird && checkFourth;
557     }
558 }
559 
MOP_xubfizrri6i6Valid(const MapleVector<Operand * > & opnds)560 inline bool MOP_xubfizrri6i6Valid(const MapleVector<Operand *> &opnds)
561 {
562     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
563         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
564         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
565         return Lsb6BitValid(lsb) && Width6BitValid(width, lsb);
566     } else {
567         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
568                               ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
569                               : true;
570         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
571                                ? Width6BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
572                                : true;
573         return checkThird && checkFourth;
574     }
575 }
576 
MOP_wsbfizrri5i5Valid(const MapleVector<Operand * > & opnds)577 inline bool MOP_wsbfizrri5i5Valid(const MapleVector<Operand *> &opnds)
578 {
579     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
580         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
581         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
582         return Lsb5BitValid(lsb) && Width5BitValid(width, lsb);
583     } else {
584         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
585                               ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
586                               : true;
587         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
588                                ? Width5BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
589                                : true;
590         return checkThird && checkFourth;
591     }
592 }
593 
MOP_xsbfizrri6i6Valid(const MapleVector<Operand * > & opnds)594 inline bool MOP_xsbfizrri6i6Valid(const MapleVector<Operand *> &opnds)
595 {
596     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
597         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
598         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
599         return Lsb6BitValid(lsb) && Width6BitValid(width, lsb);
600     } else {
601         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
602                               ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
603                               : true;
604         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
605                                ? Width6BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
606                                : true;
607         return checkThird && checkFourth;
608     }
609 }
610 
MOP_wbfirri5i5Valid(const MapleVector<Operand * > & opnds)611 inline bool MOP_wbfirri5i5Valid(const MapleVector<Operand *> &opnds)
612 {
613     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
614         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
615         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
616         return Lsb5BitValid(lsb) && Width5BitValid(width, lsb);
617     } else {
618         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
619                               ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
620                               : true;
621         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
622                                ? Width5BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
623                                : true;
624         return checkThird && checkFourth;
625     }
626 }
627 
MOP_xbfirri6i6Valid(const MapleVector<Operand * > & opnds)628 inline bool MOP_xbfirri6i6Valid(const MapleVector<Operand *> &opnds)
629 {
630     if ((opnds[kInsnThirdOpnd] != nullptr) && (opnds[kInsnFourthOpnd] != nullptr)) {
631         int64 lsb = static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue();
632         int64 width = static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue();
633         return Lsb6BitValid(lsb) && Width6BitValid(width, lsb);
634     } else {
635         bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
636                               ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
637                               : true;
638         bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
639                                ? Width6BitOnlyValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
640                                : true;
641         return checkThird && checkFourth;
642     }
643 }
644 
MOP_xlslrri6Valid(const MapleVector<Operand * > & opnds)645 inline bool MOP_xlslrri6Valid(const MapleVector<Operand *> &opnds)
646 {
647     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
648                           ? BitShift6BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
649                           : true;
650     return checkThird;
651 }
652 
MOP_wlslrri5Valid(const MapleVector<Operand * > & opnds)653 inline bool MOP_wlslrri5Valid(const MapleVector<Operand *> &opnds)
654 {
655     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
656                           ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
657                           : true;
658     return checkThird;
659 }
660 
MOP_xasrrri6Valid(const MapleVector<Operand * > & opnds)661 inline bool MOP_xasrrri6Valid(const MapleVector<Operand *> &opnds)
662 {
663     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
664                           ? BitShift6BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
665                           : true;
666     return checkThird;
667 }
668 
MOP_wasrrri5Valid(const MapleVector<Operand * > & opnds)669 inline bool MOP_wasrrri5Valid(const MapleVector<Operand *> &opnds)
670 {
671     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
672                           ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
673                           : true;
674     return checkThird;
675 }
676 
MOP_xlsrrri6Valid(const MapleVector<Operand * > & opnds)677 inline bool MOP_xlsrrri6Valid(const MapleVector<Operand *> &opnds)
678 {
679     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
680                           ? BitShift6BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
681                           : true;
682     return checkThird;
683 }
684 
MOP_wlsrrri5Valid(const MapleVector<Operand * > & opnds)685 inline bool MOP_wlsrrri5Valid(const MapleVector<Operand *> &opnds)
686 {
687     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
688                           ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
689                           : true;
690     return checkThird;
691 }
692 
MOP_wtstri32Valid(const MapleVector<Operand * > & opnds)693 inline bool MOP_wtstri32Valid(const MapleVector<Operand *> &opnds)
694 {
695     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
696                           ? Imm12BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
697                           : true;
698     return checkThird;
699 }
700 
MOP_xtstri64Valid(const MapleVector<Operand * > & opnds)701 inline bool MOP_xtstri64Valid(const MapleVector<Operand *> &opnds)
702 {
703     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
704                           ? Imm13BitMaskValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
705                           : true;
706     return checkThird;
707 }
708 
MOP_wextrrrri5Valid(const MapleVector<Operand * > & opnds)709 inline bool MOP_wextrrrri5Valid(const MapleVector<Operand *> &opnds)
710 {
711     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
712                            ? Lsb5BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
713                            : true;
714     return checkFourth;
715 }
716 
MOP_xextrrrri6Valid(const MapleVector<Operand * > & opnds)717 inline bool MOP_xextrrrri6Valid(const MapleVector<Operand *> &opnds)
718 {
719     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
720                            ? Lsb6BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
721                            : true;
722     return checkFourth;
723 }
724 
MOP_winegrrsValid(const MapleVector<Operand * > & opnds)725 inline bool MOP_winegrrsValid(const MapleVector<Operand *> &opnds)
726 {
727     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
728                           ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
729                           : true;
730     return checkThird;
731 }
732 
MOP_xinegrrsValid(const MapleVector<Operand * > & opnds)733 inline bool MOP_xinegrrsValid(const MapleVector<Operand *> &opnds)
734 {
735     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
736                           ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
737                           : true;
738     return checkThird;
739 }
740 
MOP_wldrsbValid(const MapleVector<Operand * > & opnds)741 inline bool MOP_wldrsbValid(const MapleVector<Operand *> &opnds)
742 {
743     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr8Valid(opnds[kInsnSecondOpnd]) : true;
744     return checkSecond;
745 }
746 
MOP_xldrsbValid(const MapleVector<Operand * > & opnds)747 inline bool MOP_xldrsbValid(const MapleVector<Operand *> &opnds)
748 {
749     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr8Valid(opnds[kInsnSecondOpnd]) : true;
750     return checkSecond;
751 }
752 
MOP_wldrbValid(const MapleVector<Operand * > & opnds)753 inline bool MOP_wldrbValid(const MapleVector<Operand *> &opnds)
754 {
755     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr8Valid(opnds[kInsnSecondOpnd]) : true;
756     return checkSecond;
757 }
758 
MOP_wldrshValid(const MapleVector<Operand * > & opnds)759 inline bool MOP_wldrshValid(const MapleVector<Operand *> &opnds)
760 {
761     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr16Valid(opnds[kInsnSecondOpnd]) : true;
762     return checkSecond;
763 }
764 
MOP_xldrshValid(const MapleVector<Operand * > & opnds)765 inline bool MOP_xldrshValid(const MapleVector<Operand *> &opnds)
766 {
767     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr16Valid(opnds[kInsnSecondOpnd]) : true;
768     return checkSecond;
769 }
770 
MOP_xldrswValid(const MapleVector<Operand * > & opnds)771 inline bool MOP_xldrswValid(const MapleVector<Operand *> &opnds)
772 {
773     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr32Valid(opnds[kInsnSecondOpnd]) : true;
774     return checkSecond;
775 }
776 
MOP_wldrhValid(const MapleVector<Operand * > & opnds)777 inline bool MOP_wldrhValid(const MapleVector<Operand *> &opnds)
778 {
779     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr16Valid(opnds[kInsnSecondOpnd]) : true;
780     return checkSecond;
781 }
782 
MOP_wldrValid(const MapleVector<Operand * > & opnds)783 inline bool MOP_wldrValid(const MapleVector<Operand *> &opnds)
784 {
785     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr32Valid(opnds[kInsnSecondOpnd]) : true;
786     return checkSecond;
787 }
788 
MOP_xldrValid(const MapleVector<Operand * > & opnds)789 inline bool MOP_xldrValid(const MapleVector<Operand *> &opnds)
790 {
791     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr64Valid(opnds[kInsnSecondOpnd]) : true;
792     return checkSecond;
793 }
794 
MOP_bldrValid(const MapleVector<Operand * > & opnds)795 inline bool MOP_bldrValid(const MapleVector<Operand *> &opnds)
796 {
797     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr8Valid(opnds[kInsnSecondOpnd]) : true;
798     return checkSecond;
799 }
800 
MOP_hldrValid(const MapleVector<Operand * > & opnds)801 inline bool MOP_hldrValid(const MapleVector<Operand *> &opnds)
802 {
803     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr16Valid(opnds[kInsnSecondOpnd]) : true;
804     return checkSecond;
805 }
806 
MOP_sldrValid(const MapleVector<Operand * > & opnds)807 inline bool MOP_sldrValid(const MapleVector<Operand *> &opnds)
808 {
809     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr32Valid(opnds[kInsnSecondOpnd]) : true;
810     return checkSecond;
811 }
812 
MOP_dldrValid(const MapleVector<Operand * > & opnds)813 inline bool MOP_dldrValid(const MapleVector<Operand *> &opnds)
814 {
815     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr64Valid(opnds[kInsnSecondOpnd]) : true;
816     return checkSecond;
817 }
818 
MOP_qldrValid(const MapleVector<Operand * > & opnds)819 inline bool MOP_qldrValid(const MapleVector<Operand *> &opnds)
820 {
821     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr128Valid(opnds[kInsnSecondOpnd]) : true;
822     return checkSecond;
823 }
824 
MOP_wldpValid(const MapleVector<Operand * > & opnds)825 inline bool MOP_wldpValid(const MapleVector<Operand *> &opnds)
826 {
827     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr32PairValid(opnds[kInsnThirdOpnd]) : true;
828     return checkThird;
829 }
830 
MOP_xldpValid(const MapleVector<Operand * > & opnds)831 inline bool MOP_xldpValid(const MapleVector<Operand *> &opnds)
832 {
833     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr64PairValid(opnds[kInsnThirdOpnd]) : true;
834     return checkThird;
835 }
836 
MOP_xldpswValid(const MapleVector<Operand * > & opnds)837 inline bool MOP_xldpswValid(const MapleVector<Operand *> &opnds)
838 {
839     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr32PairValid(opnds[kInsnThirdOpnd]) : true;
840     return checkThird;
841 }
842 
MOP_sldpValid(const MapleVector<Operand * > & opnds)843 inline bool MOP_sldpValid(const MapleVector<Operand *> &opnds)
844 {
845     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr32PairValid(opnds[kInsnThirdOpnd]) : true;
846     return checkThird;
847 }
848 
MOP_dldpValid(const MapleVector<Operand * > & opnds)849 inline bool MOP_dldpValid(const MapleVector<Operand *> &opnds)
850 {
851     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr64PairValid(opnds[kInsnThirdOpnd]) : true;
852     return checkThird;
853 }
854 
MOP_qldpValid(const MapleVector<Operand * > & opnds)855 inline bool MOP_qldpValid(const MapleVector<Operand *> &opnds)
856 {
857     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr128PairValid(opnds[kInsnThirdOpnd]) : true;
858     return checkThird;
859 }
860 
MOP_wldarbValid(const MapleVector<Operand * > & opnds)861 inline bool MOP_wldarbValid(const MapleVector<Operand *> &opnds)
862 {
863     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
864     return checkSecond;
865 }
866 
MOP_wldarhValid(const MapleVector<Operand * > & opnds)867 inline bool MOP_wldarhValid(const MapleVector<Operand *> &opnds)
868 {
869     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
870     return checkSecond;
871 }
872 
MOP_wldarValid(const MapleVector<Operand * > & opnds)873 inline bool MOP_wldarValid(const MapleVector<Operand *> &opnds)
874 {
875     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
876     return checkSecond;
877 }
878 
MOP_xldarValid(const MapleVector<Operand * > & opnds)879 inline bool MOP_xldarValid(const MapleVector<Operand *> &opnds)
880 {
881     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
882     return checkSecond;
883 }
884 
MOP_wmovkri16Valid(const MapleVector<Operand * > & opnds)885 inline bool MOP_wmovkri16Valid(const MapleVector<Operand *> &opnds)
886 {
887     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
888                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
889                            : true;
890     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
891                           ? ImmShift32Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
892                           : true;
893     return checkSecond && checkThird;
894 }
895 
MOP_xmovkri16Valid(const MapleVector<Operand * > & opnds)896 inline bool MOP_xmovkri16Valid(const MapleVector<Operand *> &opnds)
897 {
898     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
899                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
900                            : true;
901     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
902                           ? ImmShift64Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
903                           : true;
904     return checkSecond && checkThird;
905 }
906 
MOP_wmovzri16Valid(const MapleVector<Operand * > & opnds)907 inline bool MOP_wmovzri16Valid(const MapleVector<Operand *> &opnds)
908 {
909     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
910                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
911                            : true;
912     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
913                           ? ImmShift32Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
914                           : true;
915     return checkSecond && checkThird;
916 }
917 
MOP_xmovzri16Valid(const MapleVector<Operand * > & opnds)918 inline bool MOP_xmovzri16Valid(const MapleVector<Operand *> &opnds)
919 {
920     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
921                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
922                            : true;
923     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
924                           ? ImmShift64Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
925                           : true;
926     return checkSecond && checkThird;
927 }
928 
MOP_wmovnri16Valid(const MapleVector<Operand * > & opnds)929 inline bool MOP_wmovnri16Valid(const MapleVector<Operand *> &opnds)
930 {
931     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
932                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
933                            : true;
934     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
935                           ? ImmShift32Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
936                           : true;
937     return checkSecond && checkThird;
938 }
939 
MOP_xmovnri16Valid(const MapleVector<Operand * > & opnds)940 inline bool MOP_xmovnri16Valid(const MapleVector<Operand *> &opnds)
941 {
942     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
943                            ? Imm16BitValid(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
944                            : true;
945     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
946                           ? ImmShift64Valid(static_cast<BitShiftOperand *>(opnds[kInsnThirdOpnd])->GetValue())
947                           : true;
948     return checkSecond && checkThird;
949 }
950 
MOP_wldxrbValid(const MapleVector<Operand * > & opnds)951 inline bool MOP_wldxrbValid(const MapleVector<Operand *> &opnds)
952 {
953     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
954     return checkSecond;
955 }
956 
MOP_wldxrhValid(const MapleVector<Operand * > & opnds)957 inline bool MOP_wldxrhValid(const MapleVector<Operand *> &opnds)
958 {
959     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
960     return checkSecond;
961 }
962 
MOP_wldxrValid(const MapleVector<Operand * > & opnds)963 inline bool MOP_wldxrValid(const MapleVector<Operand *> &opnds)
964 {
965     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
966     return checkSecond;
967 }
968 
MOP_xldxrValid(const MapleVector<Operand * > & opnds)969 inline bool MOP_xldxrValid(const MapleVector<Operand *> &opnds)
970 {
971     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
972     return checkSecond;
973 }
974 
MOP_wldaxrbValid(const MapleVector<Operand * > & opnds)975 inline bool MOP_wldaxrbValid(const MapleVector<Operand *> &opnds)
976 {
977     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
978     return checkSecond;
979 }
980 
MOP_wldaxrhValid(const MapleVector<Operand * > & opnds)981 inline bool MOP_wldaxrhValid(const MapleVector<Operand *> &opnds)
982 {
983     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
984     return checkSecond;
985 }
986 
MOP_wldaxrValid(const MapleVector<Operand * > & opnds)987 inline bool MOP_wldaxrValid(const MapleVector<Operand *> &opnds)
988 {
989     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
990     return checkSecond;
991 }
992 
MOP_xldaxrValid(const MapleVector<Operand * > & opnds)993 inline bool MOP_xldaxrValid(const MapleVector<Operand *> &opnds)
994 {
995     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
996     return checkSecond;
997 }
998 
MOP_wldaxpValid(const MapleVector<Operand * > & opnds)999 inline bool MOP_wldaxpValid(const MapleVector<Operand *> &opnds)
1000 {
1001     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1002     return checkThird;
1003 }
1004 
MOP_xldaxpValid(const MapleVector<Operand * > & opnds)1005 inline bool MOP_xldaxpValid(const MapleVector<Operand *> &opnds)
1006 {
1007     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1008     return checkThird;
1009 }
1010 
MOP_wcmpriValid(const MapleVector<Operand * > & opnds)1011 inline bool MOP_wcmpriValid(const MapleVector<Operand *> &opnds)
1012 {
1013     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1014                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1015                           : true;
1016     return checkThird;
1017 }
1018 
MOP_wcmprrsValid(const MapleVector<Operand * > & opnds)1019 inline bool MOP_wcmprrsValid(const MapleVector<Operand *> &opnds)
1020 {
1021     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1022                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1023                            : true;
1024     return checkFourth;
1025 }
1026 
MOP_wwcmprreValid(const MapleVector<Operand * > & opnds)1027 inline bool MOP_wwcmprreValid(const MapleVector<Operand *> &opnds)
1028 {
1029     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1030                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1031                            : true;
1032     return checkFourth;
1033 }
1034 
MOP_xcmpriValid(const MapleVector<Operand * > & opnds)1035 inline bool MOP_xcmpriValid(const MapleVector<Operand *> &opnds)
1036 {
1037     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1038                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1039                           : true;
1040     return checkThird;
1041 }
1042 
MOP_xcmprrsValid(const MapleVector<Operand * > & opnds)1043 inline bool MOP_xcmprrsValid(const MapleVector<Operand *> &opnds)
1044 {
1045     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1046                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1047                            : true;
1048     return checkFourth;
1049 }
1050 
MOP_xwcmprreValid(const MapleVector<Operand * > & opnds)1051 inline bool MOP_xwcmprreValid(const MapleVector<Operand *> &opnds)
1052 {
1053     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1054                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1055                            : true;
1056     return checkFourth;
1057 }
1058 
MOP_wccmpriicValid(const MapleVector<Operand * > & opnds)1059 inline bool MOP_wccmpriicValid(const MapleVector<Operand *> &opnds)
1060 {
1061     // Is a five bit unsigned (positive) immediate, range 0 to 31
1062     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1063                           ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1064                           : true;
1065     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1066                            ? Nzcv4BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1067                            : true;
1068     return checkThird && checkFourth;
1069 }
1070 
MOP_wccmprricValid(const MapleVector<Operand * > & opnds)1071 inline bool MOP_wccmprricValid(const MapleVector<Operand *> &opnds)
1072 {
1073     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1074                            ? Nzcv4BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1075                            : true;
1076     return checkFourth;
1077 }
1078 
MOP_xccmpriicValid(const MapleVector<Operand * > & opnds)1079 inline bool MOP_xccmpriicValid(const MapleVector<Operand *> &opnds)
1080 {
1081     // Is a five bit unsigned (positive) immediate, range 0 to 31
1082     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1083                           ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1084                           : true;
1085     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1086                            ? Nzcv4BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1087                            : true;
1088     return checkThird && checkFourth;
1089 }
1090 
MOP_xccmprricValid(const MapleVector<Operand * > & opnds)1091 inline bool MOP_xccmprricValid(const MapleVector<Operand *> &opnds)
1092 {
1093     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1094                            ? Nzcv4BitValid(static_cast<ImmOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1095                            : true;
1096     return checkFourth;
1097 }
1098 
MOP_wcmnriValid(const MapleVector<Operand * > & opnds)1099 inline bool MOP_wcmnriValid(const MapleVector<Operand *> &opnds)
1100 {
1101     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1102                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1103                           : true;
1104     return checkThird;
1105 }
1106 
MOP_wcmnrrsValid(const MapleVector<Operand * > & opnds)1107 inline bool MOP_wcmnrrsValid(const MapleVector<Operand *> &opnds)
1108 {
1109     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1110                            ? BitShift5BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1111                            : true;
1112     return checkFourth;
1113 }
1114 
MOP_wwcmnrreValid(const MapleVector<Operand * > & opnds)1115 inline bool MOP_wwcmnrreValid(const MapleVector<Operand *> &opnds)
1116 {
1117     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1118                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1119                            : true;
1120     return checkFourth;
1121 }
1122 
MOP_xcmnriValid(const MapleVector<Operand * > & opnds)1123 inline bool MOP_xcmnriValid(const MapleVector<Operand *> &opnds)
1124 {
1125     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr)
1126                           ? Imm12BitValid(static_cast<ImmOperand *>(opnds[kInsnThirdOpnd])->GetValue())
1127                           : true;
1128     return checkThird;
1129 }
1130 
MOP_xcmnrrsValid(const MapleVector<Operand * > & opnds)1131 inline bool MOP_xcmnrrsValid(const MapleVector<Operand *> &opnds)
1132 {
1133     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1134                            ? BitShift6BitValid(static_cast<BitShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1135                            : true;
1136     return checkFourth;
1137 }
1138 
MOP_xwcmnrreValid(const MapleVector<Operand * > & opnds)1139 inline bool MOP_xwcmnrreValid(const MapleVector<Operand *> &opnds)
1140 {
1141     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr)
1142                            ? ExtendShift0To4Valid(static_cast<ExtendShiftOperand *>(opnds[kInsnFourthOpnd])->GetValue())
1143                            : true;
1144     return checkFourth;
1145 }
1146 
MOP_wtbnzValid(const MapleVector<Operand * > & opnds)1147 inline bool MOP_wtbnzValid(const MapleVector<Operand *> &opnds)
1148 {
1149     // Is the bit number to be tested, in the range 0 to 63
1150     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
1151                            ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
1152                            : true;
1153     return checkSecond;
1154 }
1155 
MOP_xtbnzValid(const MapleVector<Operand * > & opnds)1156 inline bool MOP_xtbnzValid(const MapleVector<Operand *> &opnds)
1157 {
1158     // Is the bit number to be tested, in the range 0 to 63
1159     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
1160                            ? BitShift6BitValidImm(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
1161                            : true;
1162     return checkSecond;
1163 }
1164 
MOP_wtbzValid(const MapleVector<Operand * > & opnds)1165 inline bool MOP_wtbzValid(const MapleVector<Operand *> &opnds)
1166 {
1167     // Is the bit number to be tested, in the range 0 to 31
1168     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
1169                            ? BitShift5BitValidImm(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
1170                            : true;
1171     return checkSecond;
1172 }
1173 
MOP_xtbzValid(const MapleVector<Operand * > & opnds)1174 inline bool MOP_xtbzValid(const MapleVector<Operand *> &opnds)
1175 {
1176     // Is the bit number to be tested, in the range 0 to 63
1177     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr)
1178                            ? BitShift6BitValidImm(static_cast<ImmOperand *>(opnds[kInsnSecondOpnd])->GetValue())
1179                            : true;
1180     return checkSecond;
1181 }
1182 
MOP_wstrbValid(const MapleVector<Operand * > & opnds)1183 inline bool MOP_wstrbValid(const MapleVector<Operand *> &opnds)
1184 {
1185     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr8Valid(opnds[kInsnSecondOpnd]) : true;
1186     return checkSecond;
1187 }
1188 
MOP_wstrhValid(const MapleVector<Operand * > & opnds)1189 inline bool MOP_wstrhValid(const MapleVector<Operand *> &opnds)
1190 {
1191     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr16Valid(opnds[kInsnSecondOpnd]) : true;
1192     return checkSecond;
1193 }
1194 
MOP_wstrValid(const MapleVector<Operand * > & opnds)1195 inline bool MOP_wstrValid(const MapleVector<Operand *> &opnds)
1196 {
1197     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr32Valid(opnds[kInsnSecondOpnd]) : true;
1198     return checkSecond;
1199 }
1200 
MOP_xstrValid(const MapleVector<Operand * > & opnds)1201 inline bool MOP_xstrValid(const MapleVector<Operand *> &opnds)
1202 {
1203     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr64Valid(opnds[kInsnSecondOpnd]) : true;
1204     return checkSecond;
1205 }
1206 
MOP_sstrValid(const MapleVector<Operand * > & opnds)1207 inline bool MOP_sstrValid(const MapleVector<Operand *> &opnds)
1208 {
1209     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr32Valid(opnds[kInsnSecondOpnd]) : true;
1210     return checkSecond;
1211 }
1212 
MOP_dstrValid(const MapleVector<Operand * > & opnds)1213 inline bool MOP_dstrValid(const MapleVector<Operand *> &opnds)
1214 {
1215     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr64Valid(opnds[kInsnSecondOpnd]) : true;
1216     return checkSecond;
1217 }
1218 
MOP_qstrValid(const MapleVector<Operand * > & opnds)1219 inline bool MOP_qstrValid(const MapleVector<Operand *> &opnds)
1220 {
1221     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? StrLdr128Valid(opnds[kInsnSecondOpnd]) : true;
1222     return checkSecond;
1223 }
1224 
MOP_wstpValid(const MapleVector<Operand * > & opnds)1225 inline bool MOP_wstpValid(const MapleVector<Operand *> &opnds)
1226 {
1227     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr32PairValid(opnds[kInsnThirdOpnd]) : true;
1228     return checkThird;
1229 }
1230 
MOP_xstpValid(const MapleVector<Operand * > & opnds)1231 inline bool MOP_xstpValid(const MapleVector<Operand *> &opnds)
1232 {
1233     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr64PairValid(opnds[kInsnThirdOpnd]) : true;
1234     return checkThird;
1235 }
1236 
MOP_sstpValid(const MapleVector<Operand * > & opnds)1237 inline bool MOP_sstpValid(const MapleVector<Operand *> &opnds)
1238 {
1239     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr32PairValid(opnds[kInsnThirdOpnd]) : true;
1240     return checkThird;
1241 }
1242 
MOP_dstpValid(const MapleVector<Operand * > & opnds)1243 inline bool MOP_dstpValid(const MapleVector<Operand *> &opnds)
1244 {
1245     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr64PairValid(opnds[kInsnThirdOpnd]) : true;
1246     return checkThird;
1247 }
1248 
MOP_qstpValid(const MapleVector<Operand * > & opnds)1249 inline bool MOP_qstpValid(const MapleVector<Operand *> &opnds)
1250 {
1251     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? StrLdr128PairValid(opnds[kInsnThirdOpnd]) : true;
1252     return checkThird;
1253 }
1254 
MOP_wstlrbValid(const MapleVector<Operand * > & opnds)1255 inline bool MOP_wstlrbValid(const MapleVector<Operand *> &opnds)
1256 {
1257     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
1258     return checkSecond;
1259 }
1260 
MOP_wstlrhValid(const MapleVector<Operand * > & opnds)1261 inline bool MOP_wstlrhValid(const MapleVector<Operand *> &opnds)
1262 {
1263     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
1264     return checkSecond;
1265 }
1266 
MOP_wstlrValid(const MapleVector<Operand * > & opnds)1267 inline bool MOP_wstlrValid(const MapleVector<Operand *> &opnds)
1268 {
1269     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
1270     return checkSecond;
1271 }
1272 
MOP_xstlrValid(const MapleVector<Operand * > & opnds)1273 inline bool MOP_xstlrValid(const MapleVector<Operand *> &opnds)
1274 {
1275     bool checkSecond = (opnds[kInsnSecondOpnd] != nullptr) ? IsOfstZero(opnds[kInsnSecondOpnd]) : true;
1276     return checkSecond;
1277 }
1278 
MOP_wstxrbValid(const MapleVector<Operand * > & opnds)1279 inline bool MOP_wstxrbValid(const MapleVector<Operand *> &opnds)
1280 {
1281     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1282     return checkThird;
1283 }
1284 
MOP_wstxrhValid(const MapleVector<Operand * > & opnds)1285 inline bool MOP_wstxrhValid(const MapleVector<Operand *> &opnds)
1286 {
1287     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1288     return checkThird;
1289 }
1290 
MOP_wstxrValid(const MapleVector<Operand * > & opnds)1291 inline bool MOP_wstxrValid(const MapleVector<Operand *> &opnds)
1292 {
1293     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1294     return checkThird;
1295 }
1296 
MOP_xstxrValid(const MapleVector<Operand * > & opnds)1297 inline bool MOP_xstxrValid(const MapleVector<Operand *> &opnds)
1298 {
1299     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1300     return checkThird;
1301 }
1302 
MOP_wstlxrbValid(const MapleVector<Operand * > & opnds)1303 inline bool MOP_wstlxrbValid(const MapleVector<Operand *> &opnds)
1304 {
1305     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1306     return checkThird;
1307 }
1308 
MOP_wstlxrhValid(const MapleVector<Operand * > & opnds)1309 inline bool MOP_wstlxrhValid(const MapleVector<Operand *> &opnds)
1310 {
1311     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1312     return checkThird;
1313 }
1314 
MOP_wstlxrValid(const MapleVector<Operand * > & opnds)1315 inline bool MOP_wstlxrValid(const MapleVector<Operand *> &opnds)
1316 {
1317     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1318     return checkThird;
1319 }
1320 
MOP_xstlxrValid(const MapleVector<Operand * > & opnds)1321 inline bool MOP_xstlxrValid(const MapleVector<Operand *> &opnds)
1322 {
1323     bool checkThird = (opnds[kInsnThirdOpnd] != nullptr) ? IsOfstZero(opnds[kInsnThirdOpnd]) : true;
1324     return checkThird;
1325 }
1326 
MOP_wstlxpValid(const MapleVector<Operand * > & opnds)1327 inline bool MOP_wstlxpValid(const MapleVector<Operand *> &opnds)
1328 {
1329     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr) ? IsOfstZero(opnds[kInsnFourthOpnd]) : true;
1330     return checkFourth;
1331 }
1332 
MOP_xstlxpValid(const MapleVector<Operand * > & opnds)1333 inline bool MOP_xstlxpValid(const MapleVector<Operand *> &opnds)
1334 {
1335     bool checkFourth = (opnds[kInsnFourthOpnd] != nullptr) ? IsOfstZero(opnds[kInsnFourthOpnd]) : true;
1336     return checkFourth;
1337 }
1338 
MOP_brkValid(const MapleVector<Operand * > & opnds)1339 inline bool MOP_brkValid(const MapleVector<Operand *> &opnds)
1340 {
1341     bool checkFirst = (opnds[kInsnFirstOpnd] != nullptr)
1342                           ? Imm16BitValidImm(static_cast<ImmOperand *>(opnds[kInsnFirstOpnd])->GetValue())
1343                           : true;
1344     return checkFirst;
1345 }
1346 
MOP_assert_nonnullValid(const MapleVector<Operand * > & opnds)1347 inline bool MOP_assert_nonnullValid(const MapleVector<Operand *> &opnds)
1348 {
1349     return MOP_wldrValid(opnds);
1350 }
1351 } /* namespace maplebe */
1352 #endif /* MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_MOP_VALID_H */
1353