[AMDGPU] Make disassembler convertFMAanyK call more generic
authorJoe Nash <Joseph.Nash@amd.com>
Tue, 11 Oct 2022 14:24:52 +0000 (10:24 -0400)
committerJoe Nash <Joseph.Nash@amd.com>
Tue, 11 Oct 2022 15:22:25 +0000 (11:22 -0400)
Make support more generic to support future instructions.
Currently NFC.

Reviewed By: foad, arsenm

Differential Revision: https://reviews.llvm.org/D135678

llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp

index 9011b4b..4745a35 100644 (file)
@@ -704,8 +704,8 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
 
   int ImmLitIdx =
       AMDGPU::getNamedOperandIdx(MI.getOpcode(), AMDGPU::OpName::imm);
-  bool isVOP2 = MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::VOP2;
-  if (Res && ImmLitIdx != -1 && (isVOP2 || AMDGPU::isVOPD(MI.getOpcode())))
+  bool IsSOPK = MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::SOPK;
+  if (Res && ImmLitIdx != -1 && !IsSOPK)
     Res = convertFMAanyK(MI, ImmLitIdx);
 
   // if the opcode was not recognized we'll assume a Size of 4 bytes