#include "pm4.hpp"

const char *gnm::pm4OpcodeToString(int opcode) {
  switch (opcode) {
  case IT_NOP:
    return "IT_NOP";
  case IT_SET_BASE:
    return "IT_SET_BASE";
  case IT_CLEAR_STATE:
    return "IT_CLEAR_STATE";
  case IT_INDEX_BUFFER_SIZE:
    return "IT_INDEX_BUFFER_SIZE";
  case IT_DISPATCH_DIRECT:
    return "IT_DISPATCH_DIRECT";
  case IT_DISPATCH_INDIRECT:
    return "IT_DISPATCH_INDIRECT";
  case IT_ATOMIC_GDS:
    return "IT_ATOMIC_GDS";
  case IT_OCCLUSION_QUERY:
    return "IT_OCCLUSION_QUERY";
  case IT_SET_PREDICATION:
    return "IT_SET_PREDICATION";
  case IT_REG_RMW:
    return "IT_REG_RMW";
  case IT_COND_EXEC:
    return "IT_COND_EXEC";
  case IT_PRED_EXEC:
    return "IT_PRED_EXEC";
  case IT_DRAW_INDIRECT:
    return "IT_DRAW_INDIRECT";
  case IT_DRAW_INDEX_INDIRECT:
    return "IT_DRAW_INDEX_INDIRECT";
  case IT_INDEX_BASE:
    return "IT_INDEX_BASE";
  case IT_DRAW_INDEX_2:
    return "IT_DRAW_INDEX_2";
  case IT_CONTEXT_CONTROL:
    return "IT_CONTEXT_CONTROL";
  case IT_INDEX_TYPE:
    return "IT_INDEX_TYPE";
  case IT_DRAW_INDIRECT_MULTI:
    return "IT_DRAW_INDIRECT_MULTI";
  case IT_DRAW_INDEX_AUTO:
    return "IT_DRAW_INDEX_AUTO";
  case IT_NUM_INSTANCES:
    return "IT_NUM_INSTANCES";
  case IT_DRAW_INDEX_MULTI_AUTO:
    return "IT_DRAW_INDEX_MULTI_AUTO";
  case IT_INDIRECT_BUFFER_CNST:
    return "IT_INDIRECT_BUFFER_CNST";
  case IT_STRMOUT_BUFFER_UPDATE:
    return "IT_STRMOUT_BUFFER_UPDATE";
  case IT_DRAW_INDEX_OFFSET_2:
    return "IT_DRAW_INDEX_OFFSET_2";
  case IT_DRAW_PREAMBLE:
    return "IT_DRAW_PREAMBLE";
  case IT_WRITE_DATA:
    return "IT_WRITE_DATA";
  case IT_DRAW_INDEX_INDIRECT_MULTI:
    return "IT_DRAW_INDEX_INDIRECT_MULTI";
  case IT_MEM_SEMAPHORE:
    return "IT_MEM_SEMAPHORE";
  case IT_COPY_DW:
    return "IT_COPY_DW";
  case IT_WAIT_REG_MEM:
    return "IT_WAIT_REG_MEM";
  case IT_INDIRECT_BUFFER:
    return "IT_INDIRECT_BUFFER";
  case IT_COPY_DATA:
    return "IT_COPY_DATA";
  case IT_PFP_SYNC_ME:
    return "IT_PFP_SYNC_ME";
  case IT_SURFACE_SYNC:
    return "IT_SURFACE_SYNC";
  case IT_COND_WRITE:
    return "IT_COND_WRITE";
  case IT_EVENT_WRITE:
    return "IT_EVENT_WRITE";
  case IT_EVENT_WRITE_EOP:
    return "IT_EVENT_WRITE_EOP";
  case IT_EVENT_WRITE_EOS:
    return "IT_EVENT_WRITE_EOS";
  case IT_RELEASE_MEM:
    return "IT_RELEASE_MEM";
  case IT_PREAMBLE_CNTL:
    return "IT_PREAMBLE_CNTL";
  case IT_DMA_DATA:
    return "IT_DMA_DATA";
  case IT_ACQUIRE_MEM:
    return "IT_ACQUIRE_MEM";
  case IT_REWIND:
    return "IT_REWIND";
  case IT_LOAD_UCONFIG_REG:
    return "IT_LOAD_UCONFIG_REG";
  case IT_LOAD_SH_REG:
    return "IT_LOAD_SH_REG";
  case IT_LOAD_CONFIG_REG:
    return "IT_LOAD_CONFIG_REG";
  case IT_LOAD_CONTEXT_REG:
    return "IT_LOAD_CONTEXT_REG";
  case IT_SET_CONFIG_REG:
    return "IT_SET_CONFIG_REG";
  case IT_SET_CONTEXT_REG:
    return "IT_SET_CONTEXT_REG";
  case IT_SET_CONTEXT_REG_INDIRECT:
    return "IT_SET_CONTEXT_REG_INDIRECT";
  case IT_SET_SH_REG:
    return "IT_SET_SH_REG";
  case IT_SET_SH_REG_OFFSET:
    return "IT_SET_SH_REG_OFFSET";
  case IT_SET_QUEUE_REG:
    return "IT_SET_QUEUE_REG";
  case IT_SET_UCONFIG_REG:
    return "IT_SET_UCONFIG_REG";
  case IT_SCRATCH_RAM_WRITE:
    return "IT_SCRATCH_RAM_WRITE";
  case IT_SCRATCH_RAM_READ:
    return "IT_SCRATCH_RAM_READ";
  case IT_LOAD_CONST_RAM:
    return "IT_LOAD_CONST_RAM";
  case IT_WRITE_CONST_RAM:
    return "IT_WRITE_CONST_RAM";
  case IT_DUMP_CONST_RAM:
    return "IT_DUMP_CONST_RAM";
  case IT_INCREMENT_CE_COUNTER:
    return "IT_INCREMENT_CE_COUNTER";
  case IT_INCREMENT_DE_COUNTER:
    return "IT_INCREMENT_DE_COUNTER";
  case IT_WAIT_ON_CE_COUNTER:
    return "IT_WAIT_ON_CE_COUNTER";
  case IT_WAIT_ON_DE_COUNTER_DIFF:
    return "IT_WAIT_ON_DE_COUNTER_DIFF";
  case IT_SET_CE_DE_COUNTERS:
    return "IT_SET_CE_DE_COUNTERS";
  case IT_WAIT_ON_AVAIL_BUFFER:
    return "IT_WAIT_ON_AVAIL_BUFFER";
  case IT_SWITCH_BUFFER:
    return "IT_SWITCH_BUFFER";
  case IT_SET_RESOURCES:
    return "IT_SET_RESOURCES";
  case IT_MAP_PROCESS:
    return "IT_MAP_PROCESS";
  case IT_MAP_QUEUES:
    return "IT_MAP_QUEUES";
  case IT_UNMAP_QUEUES:
    return "IT_UNMAP_QUEUES";
  case IT_QUERY_STATUS:
    return "IT_QUERY_STATUS";
  case IT_RUN_LIST:
    return "IT_RUN_LIST";
  case IT_DISPATCH_DRAW_PREAMBLE:
    return "IT_DISPATCH_DRAW_PREAMBLE";
  case IT_DISPATCH_DRAW:
    return "IT_DISPATCH_DRAW";
  }

  return nullptr;
}