[llvm] [AMDGPU][MC] Improve error message for missing dim operand (PR #96588)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 08:25:12 PDT 2024


================
@@ -4006,6 +4007,52 @@ bool AMDGPUAsmParser::validateMIMGGatherDMask(const MCInst &Inst) {
   return DMask == 0x1 || DMask == 0x2 || DMask == 0x4 || DMask == 0x8;
 }
 
+bool AMDGPUAsmParser::validateMIMGDim(const MCInst &Inst,
+                                      const OperandVector &Operands) {
+  const unsigned Opc = Inst.getOpcode();
+  const MCInstrDesc &Desc = MII.get(Opc);
+
+  if ((Desc.TSFlags & MIMGFlags) == 0)
+    return true;
+
+  if (!isGFX10Plus())
+    return true;
+
+  switch (Opc) {
+  case IMAGE_BVH64_INTERSECT_RAY_a16_gfx12:
----------------
arsenm wrote:

Can we avoid this hardcoded switch of specific opcodes? 

https://github.com/llvm/llvm-project/pull/96588


More information about the llvm-commits mailing list