v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
decoder-arm64-inl.h
Go to the documentation of this file.
1// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_ARM64_DECODER_ARM64_INL_H_
6#define V8_CODEGEN_ARM64_DECODER_ARM64_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
11namespace v8 {
12namespace internal {
13
14// Top-level instruction decode function.
15template <typename V>
17 if (instr->Bits(28, 27) == 0) {
18 V::VisitUnallocated(instr);
19 } else {
20 switch (instr->Bits(27, 24)) {
21 // 0: PC relative addressing.
22 case 0x0:
23 DecodePCRelAddressing(instr);
24 break;
25
26 // 1: Add/sub immediate.
27 case 0x1:
28 DecodeAddSubImmediate(instr);
29 break;
30
31 // A: Logical shifted register.
32 // Add/sub with carry.
33 // Conditional compare register.
34 // Conditional compare immediate.
35 // Conditional select.
36 // Data processing 1 source.
37 // Data processing 2 source.
38 // B: Add/sub shifted register.
39 // Add/sub extended register.
40 // Data processing 3 source.
41 case 0xA:
42 case 0xB:
43 DecodeDataProcessing(instr);
44 break;
45
46 // 2: Logical immediate.
47 // Move wide immediate.
48 case 0x2:
49 DecodeLogical(instr);
50 break;
51
52 // 3: Bitfield.
53 // Extract.
54 case 0x3:
55 DecodeBitfieldExtract(instr);
56 break;
57
58 // 4: Unconditional branch immediate.
59 // Exception generation.
60 // Compare and branch immediate.
61 // 5: Compare and branch immediate.
62 // Conditional branch.
63 // System.
64 // 6,7: Unconditional branch.
65 // Test and branch immediate.
66 case 0x4:
67 case 0x5:
68 case 0x6:
69 case 0x7:
70 DecodeBranchSystemException(instr);
71 break;
72
73 // 8,9: Load/store register pair post-index.
74 // Load register literal.
75 // Load/store register unscaled immediate.
76 // Load/store register immediate post-index.
77 // Load/store register immediate pre-index.
78 // Load/store register offset.
79 // Load/store exclusive.
80 // Load/store ordered.
81 // Compare and swap [Armv8.1].
82 // Compare and swap pair [Armv8.1].
83 // Atomic memory operations [Armv8.1].
84 // C,D: Load/store register pair offset.
85 // Load/store register pair pre-index.
86 // Load/store register unsigned immediate.
87 // Advanced SIMD.
88 case 0x8:
89 case 0x9:
90 case 0xC:
91 case 0xD:
92 DecodeLoadStore(instr);
93 break;
94
95 // E: FP fixed point conversion.
96 // FP integer conversion.
97 // FP data processing 1 source.
98 // FP compare.
99 // FP immediate.
100 // FP data processing 2 source.
101 // FP conditional compare.
102 // FP conditional select.
103 // Advanced SIMD.
104 // F: FP data processing 3 source.
105 // Advanced SIMD.
106 case 0xE:
107 case 0xF:
108 DecodeFP(instr);
109 break;
110 }
111 }
112}
113
114template <typename V>
116 DCHECK_EQ(0x0, instr->Bits(27, 24));
117 // We know bit 28 is set, as <b28:b27> = 0 is filtered out at the top level
118 // decode.
119 DCHECK_EQ(0x1, instr->Bit(28));
120 V::VisitPCRelAddressing(instr);
121}
122
123template <typename V>
125 DCHECK_EQ(0x4, instr->Bits(27, 24) & 0xC); // 0x4, 0x5, 0x6, 0x7
126
127 switch (instr->Bits(31, 29)) {
128 case 0:
129 case 4: {
130 V::VisitUnconditionalBranch(instr);
131 break;
132 }
133 case 1:
134 case 5: {
135 if (instr->Bit(25) == 0) {
136 V::VisitCompareBranch(instr);
137 } else {
138 V::VisitTestBranch(instr);
139 }
140 break;
141 }
142 case 2: {
143 if (instr->Bit(25) == 0) {
144 if ((instr->Bit(24) == 0x1) ||
145 (instr->Mask(0x01000010) == 0x00000010)) {
146 V::VisitUnallocated(instr);
147 } else {
148 V::VisitConditionalBranch(instr);
149 }
150 } else {
151 V::VisitUnallocated(instr);
152 }
153 break;
154 }
155 case 6: {
156 if (instr->Bit(25) == 0) {
157 if (instr->Bit(24) == 0) {
158 if ((instr->Bits(4, 2) != 0) ||
159 (instr->Mask(0x00E0001D) == 0x00200001) ||
160 (instr->Mask(0x00E0001D) == 0x00400001) ||
161 (instr->Mask(0x00E0001E) == 0x00200002) ||
162 (instr->Mask(0x00E0001E) == 0x00400002) ||
163 (instr->Mask(0x00E0001C) == 0x00600000) ||
164 (instr->Mask(0x00E0001C) == 0x00800000) ||
165 (instr->Mask(0x00E0001F) == 0x00A00000) ||
166 (instr->Mask(0x00C0001C) == 0x00C00000)) {
167 V::VisitUnallocated(instr);
168 } else {
169 V::VisitException(instr);
170 }
171 } else {
172 if (instr->Bits(23, 22) == 0) {
173 const Instr masked_003FF0E0 = instr->Mask(0x003FF0E0);
174 if ((instr->Bits(21, 19) == 0x4) ||
175 (masked_003FF0E0 == 0x00033000) ||
176 (masked_003FF0E0 == 0x003FF020) ||
177 (masked_003FF0E0 == 0x003FF060) ||
178 (masked_003FF0E0 == 0x003FF0E0) ||
179 (instr->Mask(0x00388000) == 0x00008000) ||
180 (instr->Mask(0x0038E000) == 0x00000000) ||
181 (instr->Mask(0x0039E000) == 0x00002000) ||
182 (instr->Mask(0x003AE000) == 0x00002000) ||
183 (instr->Mask(0x003CE000) == 0x00042000) ||
184 (instr->Mask(0x0038F000) == 0x00005000) ||
185 (instr->Mask(0x0038E000) == 0x00006000)) {
186 V::VisitUnallocated(instr);
187 } else {
188 V::VisitSystem(instr);
189 }
190 } else {
191 V::VisitUnallocated(instr);
192 }
193 }
194 } else {
195 if ((instr->Bit(24) == 0x1) || (instr->Bits(20, 16) != 0x1F) ||
196 (instr->Bits(15, 10) != 0) || (instr->Bits(4, 0) != 0) ||
197 (instr->Bits(24, 21) == 0x3) || (instr->Bits(24, 22) == 0x3)) {
198 V::VisitUnallocated(instr);
199 } else {
200 V::VisitUnconditionalBranchToRegister(instr);
201 }
202 }
203 break;
204 }
205 case 3:
206 case 7: {
207 V::VisitUnallocated(instr);
208 break;
209 }
210 }
211}
212
213template <typename V>
215 DCHECK_EQ(0x8, instr->Bits(27, 24) & 0xA); // 0x8, 0x9, 0xC, 0xD
216
217 if ((instr->Bit(28) == 0) && (instr->Bit(29) == 0) && (instr->Bit(26) == 1)) {
218 DecodeNEONLoadStore(instr);
219 return;
220 }
221
222 if (instr->Bit(24) == 0) {
223 if (instr->Bit(28) == 0) {
224 if (instr->Bit(29) == 0) {
225 if (instr->Bit(26) == 0) {
226 if (instr->Mask(0xA08000) == 0x800000) {
227 V::VisitUnallocated(instr);
228 } else if (instr->Mask(0xA08000) == 0) {
229 // Load/Store exclusive without acquire/release are unimplemented.
230 V::VisitUnimplemented(instr);
231 } else {
232 V::VisitLoadStoreAcquireRelease(instr);
233 }
234 } else {
235 // This is handled by DecodeNEONLoadStore().
236 UNREACHABLE();
237 }
238 } else {
239 if ((instr->Bits(31, 30) == 0x3) ||
240 (instr->Mask(0xC4400000) == 0x40000000)) {
241 V::VisitUnallocated(instr);
242 } else {
243 if (instr->Bit(23) == 0) {
244 if (instr->Mask(0xC4400000) == 0xC0400000) {
245 V::VisitUnallocated(instr);
246 } else {
247 // Nontemporals are unimplemented.
248 V::VisitUnimplemented(instr);
249 }
250 } else {
251 V::VisitLoadStorePairPostIndex(instr);
252 }
253 }
254 }
255 } else {
256 if (instr->Bit(29) == 0) {
257 if (instr->Mask(0xC4000000) == 0xC4000000) {
258 V::VisitUnallocated(instr);
259 } else {
260 V::VisitLoadLiteral(instr);
261 }
262 } else {
263 if ((instr->Mask(0x44800000) == 0x44800000) ||
264 (instr->Mask(0x84800000) == 0x84800000)) {
265 V::VisitUnallocated(instr);
266 } else {
267 if (instr->Bit(21) == 0) {
268 switch (instr->Bits(11, 10)) {
269 case 0: {
270 V::VisitLoadStoreUnscaledOffset(instr);
271 break;
272 }
273 case 1: {
274 if (instr->Mask(0xC4C00000) == 0xC0800000) {
275 V::VisitUnallocated(instr);
276 } else {
277 V::VisitLoadStorePostIndex(instr);
278 }
279 break;
280 }
281 case 2: {
282 // TODO(all): VisitLoadStoreRegisterOffsetUnpriv.
283 V::VisitUnimplemented(instr);
284 break;
285 }
286 case 3: {
287 if (instr->Mask(0xC4C00000) == 0xC0800000) {
288 V::VisitUnallocated(instr);
289 } else {
290 V::VisitLoadStorePreIndex(instr);
291 }
292 break;
293 }
294 }
295 } else {
296 if (instr->Bits(11, 10) == 0x2) {
297 if (instr->Bit(14) == 0) {
298 V::VisitUnallocated(instr);
299 } else {
300 V::VisitLoadStoreRegisterOffset(instr);
301 }
302 } else {
303 if ((instr->Bits(11, 10) == 0x0) &&
304 (instr->Bits(26, 25) == 0x0)) {
305 if ((instr->Bit(15) == 1) &&
306 ((instr->Bits(14, 12) == 0x1) || (instr->Bit(13) == 1) ||
307 (instr->Bits(14, 12) == 0x5) ||
308 ((instr->Bits(14, 12) == 0x4) &&
309 ((instr->Bit(23) == 0) ||
310 (instr->Bits(23, 22) == 0x3))))) {
311 V::VisitUnallocated(instr);
312 } else {
313 V::VisitAtomicMemory(instr);
314 }
315 } else {
316 V::VisitUnallocated(instr);
317 }
318 }
319 }
320 }
321 }
322 }
323 } else {
324 if (instr->Bit(28) == 0) {
325 if (instr->Bit(29) == 0) {
326 V::VisitUnallocated(instr);
327 } else {
328 if ((instr->Bits(31, 30) == 0x3) ||
329 (instr->Mask(0xC4400000) == 0x40000000)) {
330 V::VisitUnallocated(instr);
331 } else {
332 if (instr->Bit(23) == 0) {
333 V::VisitLoadStorePairOffset(instr);
334 } else {
335 V::VisitLoadStorePairPreIndex(instr);
336 }
337 }
338 }
339 } else {
340 if (instr->Bit(29) == 0) {
341 V::VisitUnallocated(instr);
342 } else {
343 if ((instr->Mask(0x84C00000) == 0x80C00000) ||
344 (instr->Mask(0x44800000) == 0x44800000) ||
345 (instr->Mask(0x84800000) == 0x84800000)) {
346 V::VisitUnallocated(instr);
347 } else {
348 V::VisitLoadStoreUnsignedOffset(instr);
349 }
350 }
351 }
352 }
353}
354
355template <typename V>
357 DCHECK_EQ(0x2, instr->Bits(27, 24));
358
359 if (instr->Mask(0x80400000) == 0x00400000) {
360 V::VisitUnallocated(instr);
361 } else {
362 if (instr->Bit(23) == 0) {
363 V::VisitLogicalImmediate(instr);
364 } else {
365 if (instr->Bits(30, 29) == 0x1) {
366 V::VisitUnallocated(instr);
367 } else {
368 V::VisitMoveWideImmediate(instr);
369 }
370 }
371 }
372}
373
374template <typename V>
376 DCHECK_EQ(0x3, instr->Bits(27, 24));
377
378 if ((instr->Mask(0x80400000) == 0x80000000) ||
379 (instr->Mask(0x80400000) == 0x00400000) ||
380 (instr->Mask(0x80008000) == 0x00008000)) {
381 V::VisitUnallocated(instr);
382 } else if (instr->Bit(23) == 0) {
383 if ((instr->Mask(0x80200000) == 0x00200000) ||
384 (instr->Mask(0x60000000) == 0x60000000)) {
385 V::VisitUnallocated(instr);
386 } else {
387 V::VisitBitfield(instr);
388 }
389 } else {
390 if ((instr->Mask(0x60200000) == 0x00200000) ||
391 (instr->Mask(0x60000000) != 0x00000000)) {
392 V::VisitUnallocated(instr);
393 } else {
394 V::VisitExtract(instr);
395 }
396 }
397}
398
399template <typename V>
401 DCHECK_EQ(0x1, instr->Bits(27, 24));
402 if (instr->Bit(23) == 1) {
403 V::VisitUnallocated(instr);
404 } else {
405 V::VisitAddSubImmediate(instr);
406 }
407}
408
409template <typename V>
411 DCHECK((instr->Bits(27, 24) == 0xA) || (instr->Bits(27, 24) == 0xB));
412
413 if (instr->Bit(24) == 0) {
414 if (instr->Bit(28) == 0) {
415 if (instr->Mask(0x80008000) == 0x00008000) {
416 V::VisitUnallocated(instr);
417 } else {
418 V::VisitLogicalShifted(instr);
419 }
420 } else {
421 switch (instr->Bits(23, 21)) {
422 case 0: {
423 if (instr->Mask(0x0000FC00) != 0) {
424 V::VisitUnallocated(instr);
425 } else {
426 V::VisitAddSubWithCarry(instr);
427 }
428 break;
429 }
430 case 2: {
431 if ((instr->Bit(29) == 0) || (instr->Mask(0x00000410) != 0)) {
432 V::VisitUnallocated(instr);
433 } else {
434 if (instr->Bit(11) == 0) {
435 V::VisitConditionalCompareRegister(instr);
436 } else {
437 V::VisitConditionalCompareImmediate(instr);
438 }
439 }
440 break;
441 }
442 case 4: {
443 if (instr->Mask(0x20000800) != 0x00000000) {
444 V::VisitUnallocated(instr);
445 } else {
446 V::VisitConditionalSelect(instr);
447 }
448 break;
449 }
450 case 6: {
451 if (instr->Bit(29) == 0x1) {
452 V::VisitUnallocated(instr);
453 } else {
454 if (instr->Bit(30) == 0) {
455 if ((instr->Bit(15) == 0x1) || (instr->Bits(15, 11) == 0) ||
456 (instr->Bits(15, 12) == 0x1) ||
457 (instr->Bits(15, 12) == 0x3) ||
458 (instr->Bits(15, 13) == 0x3) ||
459 (instr->Mask(0x8000EC00) == 0x00004C00) ||
460 (instr->Mask(0x8000E800) == 0x80004000) ||
461 (instr->Mask(0x8000E400) == 0x80004000)) {
462 V::VisitUnallocated(instr);
463 } else {
464 V::VisitDataProcessing2Source(instr);
465 }
466 } else {
467 if ((instr->Bit(13) == 1) || (instr->Bits(20, 16) != 0) ||
468 (instr->Bits(15, 14) != 0) ||
469 (instr->Mask(0xA01FFC00) == 0x00000C00) ||
470 (instr->Mask(0x201FF800) == 0x00001800)) {
471 V::VisitUnallocated(instr);
472 } else {
473 V::VisitDataProcessing1Source(instr);
474 }
475 }
476 break;
477 }
478 [[fallthrough]];
479 }
480 case 1:
481 case 3:
482 case 5:
483 case 7:
484 V::VisitUnallocated(instr);
485 break;
486 }
487 }
488 } else {
489 if (instr->Bit(28) == 0) {
490 if (instr->Bit(21) == 0) {
491 if ((instr->Bits(23, 22) == 0x3) ||
492 (instr->Mask(0x80008000) == 0x00008000)) {
493 V::VisitUnallocated(instr);
494 } else {
495 V::VisitAddSubShifted(instr);
496 }
497 } else {
498 if ((instr->Mask(0x00C00000) != 0x00000000) ||
499 (instr->Mask(0x00001400) == 0x00001400) ||
500 (instr->Mask(0x00001800) == 0x00001800)) {
501 V::VisitUnallocated(instr);
502 } else {
503 V::VisitAddSubExtended(instr);
504 }
505 }
506 } else {
507 if ((instr->Bit(30) == 0x1) || (instr->Bits(30, 29) == 0x1) ||
508 (instr->Mask(0xE0600000) == 0x00200000) ||
509 (instr->Mask(0xE0608000) == 0x00400000) ||
510 (instr->Mask(0x60608000) == 0x00408000) ||
511 (instr->Mask(0x60E00000) == 0x00E00000) ||
512 (instr->Mask(0x60E00000) == 0x00800000) ||
513 (instr->Mask(0x60E00000) == 0x00600000)) {
514 V::VisitUnallocated(instr);
515 } else {
516 V::VisitDataProcessing3Source(instr);
517 }
518 }
519 }
520}
521
522template <typename V>
524 DCHECK((instr->Bits(27, 24) == 0xE) || (instr->Bits(27, 24) == 0xF));
525
526 if (instr->Bit(28) == 0) {
527 DecodeNEONVectorDataProcessing(instr);
528 } else {
529 if (instr->Bits(31, 30) == 0x3) {
530 V::VisitUnallocated(instr);
531 } else if (instr->Bits(31, 30) == 0x1) {
532 DecodeNEONScalarDataProcessing(instr);
533 } else {
534 if (instr->Bit(29) == 0) {
535 if (instr->Bit(24) == 0) {
536 if (instr->Bit(21) == 0) {
537 if ((instr->Bit(23) == 1) || (instr->Bit(18) == 1) ||
538 (instr->Mask(0x80008000) == 0x00000000) ||
539 (instr->Mask(0x000E0000) == 0x00000000) ||
540 (instr->Mask(0x000E0000) == 0x000A0000) ||
541 (instr->Mask(0x00160000) == 0x00000000) ||
542 (instr->Mask(0x00160000) == 0x00120000)) {
543 V::VisitUnallocated(instr);
544 } else {
545 V::VisitFPFixedPointConvert(instr);
546 }
547 } else {
548 if (instr->Bits(15, 10) == 32) {
549 V::VisitUnallocated(instr);
550 } else if (instr->Bits(15, 10) == 0) {
551 if ((instr->Bits(23, 22) == 0x3) ||
552 (instr->Mask(0x000E0000) == 0x000A0000) ||
553 (instr->Mask(0x000E0000) == 0x000C0000) ||
554 (instr->Mask(0x00160000) == 0x00120000) ||
555 (instr->Mask(0x00160000) == 0x00140000) ||
556 (instr->Mask(0x20C40000) == 0x00800000) ||
557 (instr->Mask(0x20C60000) == 0x00840000) ||
558 (instr->Mask(0xA0C60000) == 0x80060000) ||
559 (instr->Mask(0xA0C60000) == 0x00860000) ||
560 (instr->Mask(0xA0CE0000) == 0x80860000) ||
561 (instr->Mask(0xA0CE0000) == 0x804E0000) ||
562 (instr->Mask(0xA0CE0000) == 0x000E0000) ||
563 (instr->Mask(0xA0D60000) == 0x00160000) ||
564 (instr->Mask(0xA0D60000) == 0x80560000) ||
565 (instr->Mask(0xA0D60000) == 0x80960000)) {
566 V::VisitUnallocated(instr);
567 } else {
568 V::VisitFPIntegerConvert(instr);
569 }
570 } else if (instr->Bits(14, 10) == 16) {
571 const Instr masked_A0DF8000 = instr->Mask(0xA0DF8000);
572 if ((instr->Mask(0x80180000) != 0) ||
573 (masked_A0DF8000 == 0x00020000) ||
574 (masked_A0DF8000 == 0x00030000) ||
575 (masked_A0DF8000 == 0x00068000) ||
576 (masked_A0DF8000 == 0x00428000) ||
577 (masked_A0DF8000 == 0x00430000) ||
578 (masked_A0DF8000 == 0x00468000) ||
579 (instr->Mask(0xA0D80000) == 0x00800000) ||
580 (instr->Mask(0xA0DE0000) == 0x00C00000) ||
581 (instr->Mask(0xA0DF0000) == 0x00C30000) ||
582 (instr->Mask(0xA0DC0000) == 0x00C40000)) {
583 V::VisitUnallocated(instr);
584 } else {
585 V::VisitFPDataProcessing1Source(instr);
586 }
587 } else if (instr->Bits(13, 10) == 8) {
588 if ((instr->Bits(15, 14) != 0) || (instr->Bits(2, 0) != 0) ||
589 (instr->Mask(0x80800000) != 0x00000000)) {
590 V::VisitUnallocated(instr);
591 } else {
592 V::VisitFPCompare(instr);
593 }
594 } else if (instr->Bits(12, 10) == 4) {
595 if ((instr->Bits(9, 5) != 0) ||
596 (instr->Mask(0x80800000) != 0x00000000)) {
597 V::VisitUnallocated(instr);
598 } else {
599 V::VisitFPImmediate(instr);
600 }
601 } else {
602 if (instr->Mask(0x80800000) != 0x00000000) {
603 V::VisitUnallocated(instr);
604 } else {
605 switch (instr->Bits(11, 10)) {
606 case 1: {
607 V::VisitFPConditionalCompare(instr);
608 break;
609 }
610 case 2: {
611 if ((instr->Bits(15, 14) == 0x3) ||
612 (instr->Mask(0x00009000) == 0x00009000) ||
613 (instr->Mask(0x0000A000) == 0x0000A000)) {
614 V::VisitUnallocated(instr);
615 } else {
616 V::VisitFPDataProcessing2Source(instr);
617 }
618 break;
619 }
620 case 3: {
621 V::VisitFPConditionalSelect(instr);
622 break;
623 }
624 default:
625 UNREACHABLE();
626 }
627 }
628 }
629 }
630 } else {
631 // Bit 30 == 1 has been handled earlier.
632 DCHECK_EQ(0, instr->Bit(30));
633 if (instr->Mask(0xA0800000) != 0) {
634 V::VisitUnallocated(instr);
635 } else {
636 V::VisitFPDataProcessing3Source(instr);
637 }
638 }
639 } else {
640 V::VisitUnallocated(instr);
641 }
642 }
643 }
644}
645
646template <typename V>
648 DCHECK_EQ(0x6, instr->Bits(29, 25));
649 if (instr->Bit(31) == 0) {
650 if ((instr->Bit(24) == 0) && (instr->Bit(21) == 1)) {
651 V::VisitUnallocated(instr);
652 return;
653 }
654
655 if (instr->Bit(23) == 0) {
656 if (instr->Bits(20, 16) == 0) {
657 if (instr->Bit(24) == 0) {
658 V::VisitNEONLoadStoreMultiStruct(instr);
659 } else {
660 V::VisitNEONLoadStoreSingleStruct(instr);
661 }
662 } else {
663 V::VisitUnallocated(instr);
664 }
665 } else {
666 if (instr->Bit(24) == 0) {
667 V::VisitNEONLoadStoreMultiStructPostIndex(instr);
668 } else {
669 V::VisitNEONLoadStoreSingleStructPostIndex(instr);
670 }
671 }
672 } else {
673 V::VisitUnallocated(instr);
674 }
675}
676
677template <typename V>
679 DCHECK_EQ(0x7, instr->Bits(28, 25));
680 if (instr->Bit(31) == 0) {
681 if (instr->Bit(24) == 0) {
682 if (instr->Bit(21) == 0) {
683 if (instr->Bit(15) == 0) {
684 if (instr->Bit(10) == 0) {
685 if (instr->Bit(29) == 0) {
686 if (instr->Bit(11) == 0) {
687 V::VisitNEONTable(instr);
688 } else {
689 V::VisitNEONPerm(instr);
690 }
691 } else {
692 V::VisitNEONExtract(instr);
693 }
694 } else {
695 if (instr->Bits(23, 22) == 0) {
696 V::VisitNEONCopy(instr);
697 } else {
698 if (instr->Bit(14) == 0 && instr->Bit(22)) {
699 V::VisitNEON3SameHP(instr);
700 } else {
701 V::VisitUnallocated(instr);
702 }
703 }
704 }
705 } else {
706 if (instr->Bit(10) == 1) {
707 V::VisitNEON3Extension(instr);
708 } else {
709 V::VisitUnallocated(instr);
710 }
711 }
712 } else {
713 if (instr->Bit(10) == 0) {
714 if (instr->Bit(11) == 0) {
715 V::VisitNEON3Different(instr);
716 } else {
717 if (instr->Bits(18, 17) == 0) {
718 if (instr->Bit(20) == 0) {
719 if (instr->Bit(19) == 0) {
720 V::VisitNEON2RegMisc(instr);
721 } else {
722 if (instr->Bits(30, 29) == 0x2) {
723 V::VisitUnallocated(instr);
724 } else {
725 V::VisitUnallocated(instr);
726 }
727 }
728 } else {
729 if (instr->Bit(19) == 0) {
730 V::VisitNEONAcrossLanes(instr);
731 } else {
732 // Half-precision version.
733 V::VisitNEON2RegMisc(instr);
734 }
735 }
736 } else {
737 V::VisitUnallocated(instr);
738 }
739 }
740 } else {
741 V::VisitNEON3Same(instr);
742 }
743 }
744 } else {
745 if (instr->Bit(10) == 0) {
746 V::VisitNEONByIndexedElement(instr);
747 } else {
748 if (instr->Bit(23) == 0) {
749 if (instr->Bits(22, 19) == 0) {
750 V::VisitNEONModifiedImmediate(instr);
751 } else {
752 V::VisitNEONShiftImmediate(instr);
753 }
754 } else {
755 V::VisitUnallocated(instr);
756 }
757 }
758 }
759 } else {
760 if (instr->Bit(30) == 1) {
761 V::VisitNEONSHA3(instr);
762 } else {
763 V::VisitUnallocated(instr);
764 }
765 }
766}
767
768template <typename V>
770 DCHECK_EQ(0xF, instr->Bits(28, 25));
771 if (instr->Bit(24) == 0) {
772 if (instr->Bit(21) == 0) {
773 if (instr->Bit(15) == 0) {
774 if (instr->Bit(10) == 0) {
775 if (instr->Bit(29) == 0) {
776 if (instr->Bit(11) == 0) {
777 V::VisitUnallocated(instr);
778 } else {
779 V::VisitUnallocated(instr);
780 }
781 } else {
782 V::VisitUnallocated(instr);
783 }
784 } else {
785 if (instr->Bits(23, 22) == 0) {
786 V::VisitNEONScalarCopy(instr);
787 } else {
788 V::VisitUnallocated(instr);
789 }
790 }
791 } else {
792 V::VisitUnallocated(instr);
793 }
794 } else {
795 if (instr->Bit(10) == 0) {
796 if (instr->Bit(11) == 0) {
797 V::VisitNEONScalar3Diff(instr);
798 } else {
799 if (instr->Bits(18, 17) == 0) {
800 if (instr->Bit(20) == 0) {
801 if (instr->Bit(19) == 0) {
802 V::VisitNEONScalar2RegMisc(instr);
803 } else {
804 if (instr->Bit(29) == 0) {
805 V::VisitUnallocated(instr);
806 } else {
807 V::VisitUnallocated(instr);
808 }
809 }
810 } else {
811 if (instr->Bit(19) == 0) {
812 V::VisitNEONScalarPairwise(instr);
813 } else {
814 V::VisitUnallocated(instr);
815 }
816 }
817 } else {
818 V::VisitUnallocated(instr);
819 }
820 }
821 } else {
822 V::VisitNEONScalar3Same(instr);
823 }
824 }
825 } else {
826 if (instr->Bit(10) == 0) {
827 V::VisitNEONScalarByIndexedElement(instr);
828 } else {
829 if (instr->Bit(23) == 0) {
830 V::VisitNEONScalarShiftImmediate(instr);
831 } else {
832 V::VisitUnallocated(instr);
833 }
834 }
835 }
836}
837
838} // namespace internal
839} // namespace v8
840
841#endif // V8_CODEGEN_ARM64_DECODER_ARM64_INL_H_
void DecodePCRelAddressing(Instruction *instr)
void DecodeNEONLoadStore(Instruction *instr)
void DecodeDataProcessing(Instruction *instr)
void DecodeLogical(Instruction *instr)
void DecodeAddSubImmediate(Instruction *instr)
void DecodeLoadStore(Instruction *instr)
virtual void Decode(Instruction *instr)
void DecodeFP(Instruction *instr)
void DecodeBitfieldExtract(Instruction *instr)
void DecodeBranchSystemException(Instruction *instr)
void DecodeNEONVectorDataProcessing(Instruction *instr)
void DecodeNEONScalarDataProcessing(Instruction *instr)
Instr Mask(uint32_t mask) const
int Bits(int hi, int lo) const
Instruction * instr
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485