@@ -466,15 +466,18 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
466
466
if (isGFX11Plus () && Bytes.size () >= 12 ) {
467
467
DecoderUInt128 DecW = eat12Bytes (Bytes);
468
468
469
- if (tryDecodeInst (DecoderTableGFX1196, DecoderTableGFX11_FAKE1696, MI,
469
+ if (isGFX11 () &&
470
+ tryDecodeInst (DecoderTableGFX1196, DecoderTableGFX11_FAKE1696, MI,
470
471
DecW, Address, CS))
471
472
break ;
472
473
473
- if (tryDecodeInst (DecoderTableGFX1296, DecoderTableGFX12_FAKE1696, MI,
474
+ if (isGFX12 () &&
475
+ tryDecodeInst (DecoderTableGFX1296, DecoderTableGFX12_FAKE1696, MI,
474
476
DecW, Address, CS))
475
477
break ;
476
478
477
- if (tryDecodeInst (DecoderTableGFX12W6496, MI, DecW, Address, CS))
479
+ if (isGFX12 () &&
480
+ tryDecodeInst (DecoderTableGFX12W6496, MI, DecW, Address, CS))
478
481
break ;
479
482
}
480
483
@@ -507,27 +510,32 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
507
510
tryDecodeInst (DecoderTableGFX90A64, MI, QW, Address, CS))
508
511
break ;
509
512
510
- if (tryDecodeInst (DecoderTableGFX864, MI, QW, Address, CS))
513
+ if ((isVI () || isGFX9 ()) &&
514
+ tryDecodeInst (DecoderTableGFX864, MI, QW, Address, CS))
511
515
break ;
512
516
513
- if (tryDecodeInst (DecoderTableGFX964, MI, QW, Address, CS))
517
+ if (isGFX9 () && tryDecodeInst (DecoderTableGFX964, MI, QW, Address, CS))
514
518
break ;
515
519
516
- if (tryDecodeInst (DecoderTableGFX1064, MI, QW, Address, CS))
520
+ if (isGFX10 () && tryDecodeInst (DecoderTableGFX1064, MI, QW, Address, CS))
517
521
break ;
518
522
519
- if (tryDecodeInst (DecoderTableGFX1264, DecoderTableGFX12_FAKE1664, MI, QW,
523
+ if (isGFX12 () &&
524
+ tryDecodeInst (DecoderTableGFX1264, DecoderTableGFX12_FAKE1664, MI, QW,
520
525
Address, CS))
521
526
break ;
522
527
523
- if (tryDecodeInst (DecoderTableGFX1164, DecoderTableGFX11_FAKE1664, MI, QW,
528
+ if (isGFX11 () &&
529
+ tryDecodeInst (DecoderTableGFX1164, DecoderTableGFX11_FAKE1664, MI, QW,
524
530
Address, CS))
525
531
break ;
526
532
527
- if (tryDecodeInst (DecoderTableGFX11W6464, MI, QW, Address, CS))
533
+ if (isGFX11 () &&
534
+ tryDecodeInst (DecoderTableGFX11W6464, MI, QW, Address, CS))
528
535
break ;
529
536
530
- if (tryDecodeInst (DecoderTableGFX12W6464, MI, QW, Address, CS))
537
+ if (isGFX12 () &&
538
+ tryDecodeInst (DecoderTableGFX12W6464, MI, QW, Address, CS))
531
539
break ;
532
540
}
533
541
@@ -538,13 +546,14 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
538
546
if (Bytes.size () >= 4 ) {
539
547
const uint32_t DW = eatBytes<uint32_t >(Bytes);
540
548
541
- if (tryDecodeInst (DecoderTableGFX832, MI, DW, Address, CS))
549
+ if ((isVI () || isGFX9 ()) &&
550
+ tryDecodeInst (DecoderTableGFX832, MI, DW, Address, CS))
542
551
break ;
543
552
544
553
if (tryDecodeInst (DecoderTableAMDGPU32, MI, DW, Address, CS))
545
554
break ;
546
555
547
- if (tryDecodeInst (DecoderTableGFX932, MI, DW, Address, CS))
556
+ if (isGFX9 () && tryDecodeInst (DecoderTableGFX932, MI, DW, Address, CS))
548
557
break ;
549
558
550
559
if (STI.hasFeature (AMDGPU::FeatureGFX90AInsts) &&
@@ -555,14 +564,16 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
555
564
tryDecodeInst (DecoderTableGFX10_B32, MI, DW, Address, CS))
556
565
break ;
557
566
558
- if (tryDecodeInst (DecoderTableGFX1032, MI, DW, Address, CS))
567
+ if (isGFX10 () && tryDecodeInst (DecoderTableGFX1032, MI, DW, Address, CS))
559
568
break ;
560
569
561
- if (tryDecodeInst (DecoderTableGFX1132, DecoderTableGFX11_FAKE1632, MI, DW,
570
+ if (isGFX11 () &&
571
+ tryDecodeInst (DecoderTableGFX1132, DecoderTableGFX11_FAKE1632, MI, DW,
562
572
Address, CS))
563
573
break ;
564
574
565
- if (tryDecodeInst (DecoderTableGFX1232, DecoderTableGFX12_FAKE1632, MI, DW,
575
+ if (isGFX12 () &&
576
+ tryDecodeInst (DecoderTableGFX1232, DecoderTableGFX12_FAKE1632, MI, DW,
566
577
Address, CS))
567
578
break ;
568
579
}
@@ -1750,6 +1761,10 @@ bool AMDGPUDisassembler::isGFX11Plus() const {
1750
1761
return AMDGPU::isGFX11Plus (STI);
1751
1762
}
1752
1763
1764
+ bool AMDGPUDisassembler::isGFX12 () const {
1765
+ return STI.hasFeature (AMDGPU::FeatureGFX12);
1766
+ }
1767
+
1753
1768
bool AMDGPUDisassembler::isGFX12Plus () const {
1754
1769
return AMDGPU::isGFX12Plus (STI);
1755
1770
}
0 commit comments