@@ -413,7 +413,6 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
413
413
ArrayRef<uint8_t > Bytes_,
414
414
uint64_t Address,
415
415
raw_ostream &CS) const {
416
- CommentStream = &CS;
417
416
bool IsSDWA = false ;
418
417
419
418
unsigned MaxInstBytesNum = std::min ((size_t )TargetMaxInstBytes, Bytes_.size ());
@@ -428,13 +427,11 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
428
427
// encodings
429
428
if (isGFX11Plus () && Bytes.size () >= 12 ) {
430
429
DecoderUInt128 DecW = eat12Bytes (Bytes);
431
- Res = tryDecodeInst (DecoderTableDPP8GFX1196, MI, DecW,
432
- Address);
430
+ Res = tryDecodeInst (DecoderTableDPP8GFX1196, MI, DecW, Address, CS);
433
431
if (Res && convertDPP8Inst (MI) == MCDisassembler::Success)
434
432
break ;
435
433
MI = MCInst (); // clear
436
- Res = tryDecodeInst (DecoderTableDPPGFX1196, MI, DecW,
437
- Address);
434
+ Res = tryDecodeInst (DecoderTableDPPGFX1196, MI, DecW, Address, CS);
438
435
if (Res) {
439
436
if (MCII->get (MI.getOpcode ()).TSFlags & SIInstrFlags::VOP3P)
440
437
convertVOP3PDPPInst (MI);
@@ -446,7 +443,7 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
446
443
}
447
444
break ;
448
445
}
449
- Res = tryDecodeInst (DecoderTableGFX1196, MI, DecW, Address);
446
+ Res = tryDecodeInst (DecoderTableGFX1196, MI, DecW, Address, CS );
450
447
if (Res)
451
448
break ;
452
449
}
@@ -457,7 +454,7 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
457
454
const uint64_t QW = eatBytes<uint64_t >(Bytes);
458
455
459
456
if (STI.hasFeature (AMDGPU::FeatureGFX10_BEncoding)) {
460
- Res = tryDecodeInst (DecoderTableGFX10_B64, MI, QW, Address);
457
+ Res = tryDecodeInst (DecoderTableGFX10_B64, MI, QW, Address, CS );
461
458
if (Res) {
462
459
if (AMDGPU::getNamedOperandIdx (MI.getOpcode (), AMDGPU::OpName::dpp8)
463
460
== -1 )
@@ -468,37 +465,37 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
468
465
}
469
466
}
470
467
471
- Res = tryDecodeInst (DecoderTableDPP864, MI, QW, Address);
468
+ Res = tryDecodeInst (DecoderTableDPP864, MI, QW, Address, CS );
472
469
if (Res && convertDPP8Inst (MI) == MCDisassembler::Success)
473
470
break ;
474
471
MI = MCInst (); // clear
475
472
476
- Res = tryDecodeInst (DecoderTableDPP8GFX1164, MI, QW, Address);
473
+ Res = tryDecodeInst (DecoderTableDPP8GFX1164, MI, QW, Address, CS );
477
474
if (Res && convertDPP8Inst (MI) == MCDisassembler::Success)
478
475
break ;
479
476
MI = MCInst (); // clear
480
477
481
- Res = tryDecodeInst (DecoderTableDPP64, MI, QW, Address);
478
+ Res = tryDecodeInst (DecoderTableDPP64, MI, QW, Address, CS );
482
479
if (Res) break ;
483
480
484
- Res = tryDecodeInst (DecoderTableDPPGFX1164, MI, QW, Address);
481
+ Res = tryDecodeInst (DecoderTableDPPGFX1164, MI, QW, Address, CS );
485
482
if (Res) {
486
483
if (MCII->get (MI.getOpcode ()).TSFlags & SIInstrFlags::VOPC)
487
484
convertVOPCDPPInst (MI);
488
485
break ;
489
486
}
490
487
491
- Res = tryDecodeInst (DecoderTableSDWA64, MI, QW, Address);
488
+ Res = tryDecodeInst (DecoderTableSDWA64, MI, QW, Address, CS );
492
489
if (Res) { IsSDWA = true ; break ; }
493
490
494
- Res = tryDecodeInst (DecoderTableSDWA964, MI, QW, Address);
491
+ Res = tryDecodeInst (DecoderTableSDWA964, MI, QW, Address, CS );
495
492
if (Res) { IsSDWA = true ; break ; }
496
493
497
- Res = tryDecodeInst (DecoderTableSDWA1064, MI, QW, Address);
494
+ Res = tryDecodeInst (DecoderTableSDWA1064, MI, QW, Address, CS );
498
495
if (Res) { IsSDWA = true ; break ; }
499
496
500
497
if (STI.hasFeature (AMDGPU::FeatureUnpackedD16VMem)) {
501
- Res = tryDecodeInst (DecoderTableGFX80_UNPACKED64, MI, QW, Address);
498
+ Res = tryDecodeInst (DecoderTableGFX80_UNPACKED64, MI, QW, Address, CS );
502
499
if (Res)
503
500
break ;
504
501
}
@@ -507,7 +504,7 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
507
504
// v_mad_mixhi_f16 for FMA variants. Try to decode using this special
508
505
// table first so we print the correct name.
509
506
if (STI.hasFeature (AMDGPU::FeatureFmaMixInsts)) {
510
- Res = tryDecodeInst (DecoderTableGFX9_DL64, MI, QW, Address);
507
+ Res = tryDecodeInst (DecoderTableGFX9_DL64, MI, QW, Address, CS );
511
508
if (Res)
512
509
break ;
513
510
}
@@ -519,64 +516,64 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
519
516
// Try decode 32-bit instruction
520
517
if (Bytes.size () < 4 ) break ;
521
518
const uint32_t DW = eatBytes<uint32_t >(Bytes);
522
- Res = tryDecodeInst (DecoderTableGFX832, MI, DW, Address);
519
+ Res = tryDecodeInst (DecoderTableGFX832, MI, DW, Address, CS );
523
520
if (Res) break ;
524
521
525
- Res = tryDecodeInst (DecoderTableAMDGPU32, MI, DW, Address);
522
+ Res = tryDecodeInst (DecoderTableAMDGPU32, MI, DW, Address, CS );
526
523
if (Res) break ;
527
524
528
- Res = tryDecodeInst (DecoderTableGFX932, MI, DW, Address);
525
+ Res = tryDecodeInst (DecoderTableGFX932, MI, DW, Address, CS );
529
526
if (Res) break ;
530
527
531
528
if (STI.hasFeature (AMDGPU::FeatureGFX90AInsts)) {
532
- Res = tryDecodeInst (DecoderTableGFX90A32, MI, DW, Address);
529
+ Res = tryDecodeInst (DecoderTableGFX90A32, MI, DW, Address, CS );
533
530
if (Res)
534
531
break ;
535
532
}
536
533
537
534
if (STI.hasFeature (AMDGPU::FeatureGFX10_BEncoding)) {
538
- Res = tryDecodeInst (DecoderTableGFX10_B32, MI, DW, Address);
535
+ Res = tryDecodeInst (DecoderTableGFX10_B32, MI, DW, Address, CS );
539
536
if (Res) break ;
540
537
}
541
538
542
- Res = tryDecodeInst (DecoderTableGFX1032, MI, DW, Address);
539
+ Res = tryDecodeInst (DecoderTableGFX1032, MI, DW, Address, CS );
543
540
if (Res) break ;
544
541
545
- Res = tryDecodeInst (DecoderTableGFX1132, MI, DW, Address);
542
+ Res = tryDecodeInst (DecoderTableGFX1132, MI, DW, Address, CS );
546
543
if (Res) break ;
547
544
548
545
if (Bytes.size () < 4 ) break ;
549
546
const uint64_t QW = ((uint64_t )eatBytes<uint32_t >(Bytes) << 32 ) | DW;
550
547
551
548
if (STI.hasFeature (AMDGPU::FeatureGFX940Insts)) {
552
- Res = tryDecodeInst (DecoderTableGFX94064, MI, QW, Address);
549
+ Res = tryDecodeInst (DecoderTableGFX94064, MI, QW, Address, CS );
553
550
if (Res)
554
551
break ;
555
552
}
556
553
557
554
if (STI.hasFeature (AMDGPU::FeatureGFX90AInsts)) {
558
- Res = tryDecodeInst (DecoderTableGFX90A64, MI, QW, Address);
555
+ Res = tryDecodeInst (DecoderTableGFX90A64, MI, QW, Address, CS );
559
556
if (Res)
560
557
break ;
561
558
}
562
559
563
- Res = tryDecodeInst (DecoderTableGFX864, MI, QW, Address);
560
+ Res = tryDecodeInst (DecoderTableGFX864, MI, QW, Address, CS );
564
561
if (Res) break ;
565
562
566
- Res = tryDecodeInst (DecoderTableAMDGPU64, MI, QW, Address);
563
+ Res = tryDecodeInst (DecoderTableAMDGPU64, MI, QW, Address, CS );
567
564
if (Res) break ;
568
565
569
- Res = tryDecodeInst (DecoderTableGFX964, MI, QW, Address);
566
+ Res = tryDecodeInst (DecoderTableGFX964, MI, QW, Address, CS );
570
567
if (Res) break ;
571
568
572
- Res = tryDecodeInst (DecoderTableGFX1064, MI, QW, Address);
569
+ Res = tryDecodeInst (DecoderTableGFX1064, MI, QW, Address, CS );
573
570
if (Res) break ;
574
571
575
- Res = tryDecodeInst (DecoderTableGFX1164, MI, QW, Address);
572
+ Res = tryDecodeInst (DecoderTableGFX1164, MI, QW, Address, CS );
576
573
if (Res)
577
574
break ;
578
575
579
- Res = tryDecodeInst (DecoderTableWMMAGFX1164, MI, QW, Address);
576
+ Res = tryDecodeInst (DecoderTableWMMAGFX1164, MI, QW, Address, CS );
580
577
} while (false );
581
578
582
579
if (Res && AMDGPU::isMAC (MI.getOpcode ())) {
0 commit comments